Open ghost opened 1 year ago
Flake evaluation is designed not to depend on external factors, such as which host is evaluating the flake.
I would recommend something like NixOS or home-manager to configure host environments. These each have their own ways of initializing the pkgs
module argument.
Alternatively, if you do not want to manage significant portions of your host environment declaratively, you could declare the relevant packages for each host using distinct package names. Instead of just _module.args.pkgs
, you could also add _module.args.pkgs2
or any other name. pkgs
is only "special" because it is implicitly expected by some modules. flake-parts
itself does not come with such an expectation though.
@nuusers In your case, you won't specify those host-specific overlays under perSystem
though? You can specify overlays for a NixOS system as part of the configuration:
nixpkgs.lib.nixosSystem {
inherit system specialArgs;
modules = [
{
# Specify overlays for the system
nixpkgs.overlays = overlays;
}
...
];
}
@roberth Sorry I lost my account, here is my solution: https://github.com/kekeqwq/flakes/blob/3916883f74fbcd924f5679526a7bcea996c486ea/flake-parts/nixos.nix#LL30C32-L30C32 You can close this issue.
I have two overlays, two hosts. Host 1 needs to use overlay1 Host 2 needs to use overlay1 overlay2.