Add MkSystem function to lib.

This commit is contained in:
Lorenzo Good 2025-01-26 19:20:24 -06:00
parent a3aa93106a
commit 5327a81d0b
Signed by: lorenzo
GPG key ID: 7FCD64BD81180ED0
2 changed files with 26 additions and 0 deletions

View file

@ -1,4 +1,5 @@
{ {
utils = import ./utils.nix; utils = import ./utils.nix;
getSSHKeys = (import ./keys.nix).getSSHKeys; getSSHKeys = (import ./keys.nix).getSSHKeys;
mkSystem = (import ./nixos.nix).mkSystem;
} }

25
nixos/lib/nixos.nix Normal file
View file

@ -0,0 +1,25 @@
let
foelib = import ./default.nix;
in {
mkSystem = nixpkgs: pkgs: hostname: modules:
nixpkgs.lib.nixosSystem {
modules =
[
{
nix.registry = {
nixpkgs.flake = nixpkgs;
p.flake = nixpkgs;
};
nixpkgs.pkgs = pkgs;
networking.hostname = hostname;
}
]
++ modules
++ foelib.utils.findNixFiles ../nixos;
specialArgs = {
inherit hostname foelib;
};
};
}