I’m trying to declare my Firefox config with home-manager using the firefox-addons packages from @rycee. I’m using home-manager as a flake by running nix run
.
All of the free Firefox extensions work fine, but Nix refuses to install any extension with an unfree license, even though I’ve got {nixpkgs.config.allowUnfree = true;}
included from a different file. I assume I need to override firefox-addons
to allow unfree packages, but I have no idea how to do that. Any help would be greatly appreciated.
For reference, my flake.nix
(simplified) looks like this:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
nixpkgs,
home-manager,
firefox-addons,
...
}: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
};
extraSpecialArgs = {
inherit firefox-addons system;
};
in {
packages.${system}.default = home-manager.defaultPackage.${system};
homeConfigurations = {
"user@hostname" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
inherit extraSpecialArgs;
modules = [
./modules/firefox.nix
];
};
};
};
}
And modules/firefox.nix
looks like:
{
pkgs,
system,
firefox-addons,
...
}: {
programs.firefox = {
enable = true;
package = pkgs.firefox.override {
cfg.enableGnomeExtensions = true;
};
profiles.main = {
id = 0;
extensions = with firefox-addons.packages.${system}; [
# These are free, and work completely fine
privacy-badger
ublock-origin
darkreader
wayback-machine
# These are unfree, and nix refuses to install them
tampermonkey
enhancer-for-youtube
dashlane
];
};
};
}