allow system definitions to be done in folders

This commit is contained in:
lilly 2025-03-04 22:49:45 +01:00
parent 05fbd7183c
commit f4ff592efd
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g

View file

@ -6,7 +6,11 @@ let
# call like `mkSystem "x86_64-linux" "<hostname>.eh22.intern"`
mkSystem =
systemType: name:
nixpkgs.lib.nixosSystem {
let
lib = nixpkgs.lib;
systemModule = if lib.pathIsDirectory ./${name} then ./${name}/system.nix else ./${name}.nix;
in
lib.nixosSystem {
system = systemType;
specialArgs = flake.inputs;
modules = [
@ -17,8 +21,7 @@ let
../modules/base_system.nix
../modules/user_account.nix
#../modules/mail_relay.nix
./${name}.nix
systemModule
(
let