srid / nixos-flake

A flake-parts module to manage NixOS and macOS machines, along with home-manager support, in a unified fashion.
https://community.flake.parts/nixos-flake
MIT License
175 stars 19 forks source link

need of extraModules in mkSystem for colmena #42

Closed tgunnoe closed 9 months ago

tgunnoe commented 9 months ago

I did a quick hack on a branch of mine a bit back: https://github.com/srid/nixos-flake/compare/master...tgunnoe:nixos-flake:extraModules The use case is adding colmena along with flake-parts, but extraModules in particular is needed: https://github.com/zhaofengli/colmena/issues/60

Or maybe this needs to be addressed upstream.

srid commented 9 months ago

This came up in #26 where I proposed that that it'd be better to use the nixosSystem function directly. For this reason, in fed64870d63139bd4488999a607830ca7c9125ff I exposed lib.specialArgsFor which can then be used as:

inputs.nixpkgs.lib.nixosSystem { 
  specialArgs = inputs.nixpkgs.nixos-flake.lib.specialArgsFor.nixos; 
  modules = [ .. ];
  extraModules = [ .. ];
  ..
}; 

... thus leaving you free to pass whatever other argument to nixosSystem.