From f4ff592efd816320e301cfb1fffcedfb64fcfb0a Mon Sep 17 00:00:00 2001
From: lilly
Date: Tue, 4 Mar 2025 22:49:45 +0100
Subject: [PATCH] allow system definitions to be done in folders
---
systems/default.nix | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/systems/default.nix b/systems/default.nix
index 161bbda..255d69f 100644
--- a/systems/default.nix
+++ b/systems/default.nix
@@ -6,7 +6,11 @@ let
# call like `mkSystem "x86_64-linux" ".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