diff options
author | aszlig <aszlig@redmoonstudios.org> | 2015-03-17 01:20:13 +0100 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2015-03-17 01:20:13 +0100 |
commit | 4070552a3e593d1a561073f21b55869f384fca11 (patch) | |
tree | 0788c3f561ba882db5a1985a4ed354695ccdc50f /default.nix | |
parent | c3fb4c2600b16f2b38e0d5a2eec5dd0a9bf79387 (diff) |
default.nix: Simplify/split up into release.nix.
Unfortunately, using builtins.readDir isn't very good idea here, because all file references from expression files found via readDir will have imports relative to the Nix store. We can only work around it if we copy the whole source tree into the store, but for the sake of simplicity it's also better if we use explicit imports. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/default.nix b/default.nix index 9504284b..20118162 100644 --- a/default.nix +++ b/default.nix @@ -1,17 +1,7 @@ -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); +{ + machines = { + heinrich = import ./machines/heinrich.nix; + labtop = import ./machines/labtop.nix; + mailserver = import ./machines/mailserver.nix; + }; } |