Open akavel opened 6 months ago
@akavel Just wanted to leave a note saying that I'd be happy to satisfy this use case. In fact, I'd need it for myself as well. Just not sure what the best approach is. There is --override-input
, but now we are externalizing the nixpkgs dependency outside of flake.nix
...
@srid I'm afraid both flake-parts and nixos-flake keep being super confusing to me, and it looks like I still have hard time wrapping my head around either 😓 so I only wish I could suggest some solution... The only thing I can try to say is somewhat naively from user perspective; as such, looking e.g. at https://github.com/srid/nixos-config/blob/f1e560296d62c192c6a1a1dd1ca54c237a2cbf96/flake.nix, personally the first idea that comes to my mind, is I'd love if I could e.g. replace line 97-98:
self.nixos-flake.lib.mkLinuxSystem
./systems/ax41.nix;
with something like:
self.nixos-flake.lib.mkLinuxSystemWith { nixpkgs = inputs.nixpkgs2; }
./systems/ax41.nix;
One approach we could adopt is to totally separate out the flakes. Each host gets its own flake.nix
, but there's also a common flake (containing modules used by all hosts for example) that gets shared by these flakes. The whole thing can be in a mono repo, so we would need --override-input
.
One approach we could adopt is to totally separate out the flakes. Each host gets its own
flake.nix
, but there's also a common flake (containing modules used by all hosts for example) that gets shared by these flakes. The whole thing can be in a mono repo, so we would need--override-input
.
Yup, I am able to get this working! Part of that work involves #54
I will document it all at the end.
Currently, I am trying to track nixpkgs versions separately for different hosts. My old
flake.nix
had the following:I'm trying to port this config to nixos-flake, to let me unify it with my home-manager configs. However, I noticed that nixos-flake seems to be hardcoded to use
inputs.nixpkgs
, and inputs are passed viaflake-parts.lib.mkFlake { inherit inputs; }
, so I don't see a clear way to use different nixpkgs between differentnixosConfigurations
inside nixos-flake. Do you have any suggestions how I could try doing this? I am ok to try modifying nixos-flake code, but I'd be grateful for suggestions how to try approaching that in such case; currently flake-parts is still quite confusing to me; and also you know nixos-flake better, so may have better ideas what approach could be better suited to it.