nixos/firefox: remove nixpkgs.config usage

This commit is contained in:
K900 2023-09-26 18:01:07 +03:00
parent 018f62a151
commit d3c27efa36
4 changed files with 23 additions and 11 deletions

View File

@ -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;
};
}

View File

@ -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; };

View File

@ -42,6 +42,6 @@ in
services.dbus.packages = [ pkgs.gnome-browser-connector ];
nixpkgs.config.firefox.enableGnomeExtensions = true;
programs.firefox.wrapperConfig.enableGnomeExtensions = true;
};
}

View File

@ -379,7 +379,7 @@ in
# Update the start menu for each user that is currently logged in
system.userActivationScripts.plasmaSetup = activationScript;
nixpkgs.config.firefox.enablePlasmaBrowserIntegration = true;
programs.firefox.wrapperConfig.enablePlasmaBrowserIntegration = true;
})
(mkIf (cfg.kwinrc != {}) {