about summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-03-17 00:50:41 +0100
committeraszlig <aszlig@redmoonstudios.org>2015-03-17 00:50:41 +0100
commit68f357751b9f2f405a7e43ac711f7839daf3b3f4 (patch)
treedf71c189acce18d710c7a2c5f31ab78fa454d3cb
parentff6588b7aa650c8cb6d9611d52c02c11cc1fbebb (diff)
Add a default.nix for referencing machines.
At the moment this is also the release Nix expression we're going to use
for Hydra. Right now, the machine expressions don't evaluate because
they're lacking hardware information. But apart from that we should get
out full system builds afterwards.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
-rw-r--r--default.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 00000000..9504284b
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,17 @@
+with import <nixpkgs/lib>;
+
+let
+  genFromNixFiles = path: let
+    isNixFile = name: type: hasSuffix ".nix" name && type == "regular";
+    importNixFile = name: const {
+      name = removeSuffix ".nix" name;
+      value = import (builtins.toPath "${path}/${name}");
+    };
+  in mapAttrs' importNixFile (filterAttrs isNixFile (builtins.readDir path));
+
+in {
+  machines = mapAttrs (_: cfg: (import <nixpkgs/nixos/lib/eval-config.nix> {
+    system = "x86_64-linux";
+    modules = [ cfg ];
+  }).config.system.build.toplevel) (genFromNixFiles ./machines);
+}