about summary refs log tree commit diff
path: root/lib/mk_system.nix
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2021-12-28 01:11:25 +0900
committersefidel <contact@sefidel.net>2021-12-28 01:12:48 +0900
commit56992b8c945d497a623fe693847c91235be1ae02 (patch)
tree102ff8c8872d7e14ce3e3dba69bf16685374504e /lib/mk_system.nix
downloadnixrc-56992b8c945d497a623fe693847c91235be1ae02.tar.gz
nixrc-56992b8c945d497a623fe693847c91235be1ae02.zip
initial commit
Diffstat (limited to 'lib/mk_system.nix')
-rw-r--r--lib/mk_system.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/mk_system.nix b/lib/mk_system.nix
new file mode 100644
index 0000000..ee0037b
--- /dev/null
+++ b/lib/mk_system.nix
@@ -0,0 +1,25 @@
+{ self, ... } @ args:
+
+name: nixpkgs:
+nixpkgs.lib.nixosSystem (
+  let
+    configFolder = "${self}/nixos/configurations";
+    entryPoint = "${configFolder}/${name}.nix";
+    hardware = "${configFolder}/hardware/${name}.nix";
+  in
+  {
+    system = "x86_64-linux";
+
+    modules = [
+      {
+        _module.args = args;
+        networking.hostName = name;
+        nix.flakes.enable = true;
+        system.configurationRevision = self.rev or "dirty";
+        documentation.man = { enable = true; generateCaches = true; };
+      }
+      entryPoint
+      hardware
+    ] ++ __attrValues self.nixosModules;
+  }
+)