I have tried to follow multiple guides and dotfiles to make sure the pkgs are configured correctly for nix-darwin to allow paid packages. However updating the system by running nix run command still throws warning about adding allowUnfree attribute.
I have enabled useGlobalPkgs = true
in home-manager. And I have configured nixpkgs.config for nix-darwin as well.
Here is my flake. nix-config/flake.nix at 30219dcb867de29a6ea60ba6c888d765d6dbf1fb · maulik13/nix-config · GitHub
I get the error about unfree package for a firefox addon at nix-config/programs/firefox.nix at 30219dcb867de29a6ea60ba6c888d765d6dbf1fb · maulik13/nix-config · GitHub
Any help here would be great. Many thanks!
darwin.lib.darwinSystem {
# ...
modules = [
home-manager.darwinModules.home-manager
{ nixpkgs.config = config; } # This is missing.
# ...
];
}
I tried adding that like this in my code but it did not work. I also have useGlobalPkgs = true
in my home-manager config so I assume it should pick up the nixpkgs config from nix-darwin.
darwin.lib.darwinSystem {
inherit pkgs;
inherit system;
modules = [
home-manager.darwinModules.home-manager
(
home-manager-user {
user = host.user;
path = ./systems/${host.dir}/home.nix;
}
// {
nixpkgs.config = config;
}
)
]
}
I realized that the issue is caused by a firefox addon which comes from nur
repository. I found a thread here that gave me a solution to this. After adding an overlay like this (copied from other thread), it worked fine.
# flake.nix
inputs = {
nur.url = "github:nix-community/nur";
};
# home.nix
{ inputs, ... }:
{
nixpkgs = {
overlays = [
inputs.nur.overlay
];
config = {
allowUnfree = true;
};
};
}
# firefox.nix
{ pkgs, ... }:
{
programs.firefox = {
enable = true;
profiles = {
default = {
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
enhancer-for-youtube # non-free
];
};
};
}