diff options
author | K900 <me@0upti.me> | 2023-09-26 18:01:07 +0300 |
---|---|---|
committer | K900 <me@0upti.me> | 2023-09-26 18:02:01 +0300 |
commit | d3c27efa36abeb7f65cc8764d73d7805128c5386 (patch) | |
tree | b772925983422a67aaf40fbb2618ad600b1fc480 /nixos/modules/programs | |
parent | 018f62a1515b0e71a663142807bb2b03b662997c (diff) |
nixos/firefox: remove `nixpkgs.config` usage
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r-- | nixos/modules/programs/browserpass.nix | 2 | ||||
-rw-r--r-- | nixos/modules/programs/firefox.nix | 28 |
2 files changed, 21 insertions, 9 deletions
diff --git a/nixos/modules/programs/browserpass.nix b/nixos/modules/programs/browserpass.nix index 346d38e5e8803..abd99056ff3ba 100644 --- a/nixos/modules/programs/browserpass.nix +++ b/nixos/modules/programs/browserpass.nix @@ -27,6 +27,6 @@ with lib; "opt/brave/native-messaging-hosts/${appId}".source = source "hosts/chromium"; "opt/brave/policies/managed/${appId}".source = source "policies/chromium"; }; - nixpkgs.config.firefox.enableBrowserpass = true; + programs.firefox.wrapperConfig.enableBrowserpass = true; }; } diff --git a/nixos/modules/programs/firefox.nix b/nixos/modules/programs/firefox.nix index 8653f066cf8fd..43cf64cf1d825 100644 --- a/nixos/modules/programs/firefox.nix +++ b/nixos/modules/programs/firefox.nix @@ -36,6 +36,12 @@ in ]; }; + wrapperConfig = mkOption { + type = types.attrs; + default = {}; + description = mdDoc "Arguments to pass to Firefox wrapper"; + }; + policies = mkOption { type = policyFormat.type; default = { }; @@ -227,17 +233,23 @@ in ] ++ optionals nmh.passff [ passff-host ]; + cfg = let + # copy-pasted from the wrapper; TODO: figure out fix + applicationName = cfg.package.binaryName or (lib.getName cfg.package); + + nixpkgsConfig = config.nixpkgs.config.${applicationName} or {}; + optionConfig = cfg.wrapperConfig; + nmhConfig = { + enableBrowserpass = nmh.browserpass; + enableBukubrow = nmh.bukubrow; + enableTridactylNative = nmh.tridactyl; + enableUgetIntegrator = nmh.ugetIntegrator; + enableFXCastBridge = nmh.fxCast; + }; + in nixpkgsConfig // optionConfig // nmhConfig; }) ]; - nixpkgs.config.firefox = { - enableBrowserpass = nmh.browserpass; - enableBukubrow = nmh.bukubrow; - enableTridactylNative = nmh.tridactyl; - enableUgetIntegrator = nmh.ugetIntegrator; - enableFXCastBridge = nmh.fxCast; - }; - environment.etc = let policiesJSON = policyFormat.generate "firefox-policies.json" { inherit (cfg) policies; }; |