mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-15 05:59:17 +03:00
nixos/chromium: don't generate empty files
This commit is contained in:
parent
5538de972d
commit
a73a43d737
1 changed files with 8 additions and 8 deletions
|
@ -22,7 +22,7 @@ in
|
||||||
enable = mkEnableOption (lib.mdDoc "{command}`chromium` policies");
|
enable = mkEnableOption (lib.mdDoc "{command}`chromium` policies");
|
||||||
|
|
||||||
extensions = mkOption {
|
extensions = mkOption {
|
||||||
type = types.listOf types.str;
|
type = with types; nullOr (listOf str);
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
List of chromium extensions to install.
|
List of chromium extensions to install.
|
||||||
For list of plugins ids see id in url of extensions on
|
For list of plugins ids see id in url of extensions on
|
||||||
|
@ -33,7 +33,7 @@ in
|
||||||
[ExtensionInstallForcelist](https://cloud.google.com/docs/chrome-enterprise/policies/?policy=ExtensionInstallForcelist)
|
[ExtensionInstallForcelist](https://cloud.google.com/docs/chrome-enterprise/policies/?policy=ExtensionInstallForcelist)
|
||||||
for additional details.
|
for additional details.
|
||||||
'';
|
'';
|
||||||
default = [];
|
default = null;
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
[
|
[
|
||||||
"chlffgpmiacpedhhbkiomidkjlcfhogd" # pushbullet
|
"chlffgpmiacpedhhbkiomidkjlcfhogd" # pushbullet
|
||||||
|
@ -102,14 +102,14 @@ in
|
||||||
config = {
|
config = {
|
||||||
environment.etc = lib.mkIf cfg.enable {
|
environment.etc = lib.mkIf cfg.enable {
|
||||||
# for chromium
|
# for chromium
|
||||||
"chromium/policies/managed/default.json" = { text = builtins.toJSON defaultProfile; };
|
"chromium/policies/managed/default.json" = lib.mkIf (defaultProfile != {}) { text = builtins.toJSON defaultProfile; };
|
||||||
"chromium/policies/managed/extra.json" = { text = builtins.toJSON cfg.extraOpts; };
|
"chromium/policies/managed/extra.json" = lib.mkIf (cfg.extraOpts != {}) { text = builtins.toJSON cfg.extraOpts; };
|
||||||
# for google-chrome https://www.chromium.org/administrators/linux-quick-start
|
# for google-chrome https://www.chromium.org/administrators/linux-quick-start
|
||||||
"opt/chrome/policies/managed/default.json" = { text = builtins.toJSON defaultProfile; };
|
"opt/chrome/policies/managed/default.json" = lib.mkIf (defaultProfile != {}) { text = builtins.toJSON defaultProfile; };
|
||||||
"opt/chrome/policies/managed/extra.json" = { text = builtins.toJSON cfg.extraOpts; };
|
"opt/chrome/policies/managed/extra.json" = lib.mkIf (cfg.extraOpts != {}) { text = builtins.toJSON cfg.extraOpts; };
|
||||||
# for brave
|
# for brave
|
||||||
"brave/policies/managed/default.json" = { text = builtins.toJSON defaultProfile; };
|
"brave/policies/managed/default.json" = lib.mkIf (defaultProfile != {}) { text = builtins.toJSON defaultProfile; };
|
||||||
"brave/policies/managed/extra.json" = { text = builtins.toJSON cfg.extraOpts; };
|
"brave/policies/managed/extra.json" = lib.mkIf (cfg.extraOpts != {}) { text = builtins.toJSON cfg.extraOpts; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue