summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2018-11-30 11:27:47 +0100
committertv <tv@krebsco.de>2018-11-30 11:27:47 +0100
commit9c97865f15a07b910a13de6ae1d6ab6b14ade9a9 (patch)
tree93196eef6725eb51758ea14fdff0d5eaedd8e2e3
parent94a09258ad3202cfba1bcba8cdbf99b51f5aae86 (diff)
default.nix: simplify system evaluations
-rw-r--r--default.nix21
1 files changed, 7 insertions, 14 deletions
diff --git a/default.nix b/default.nix
index 5ae8e399e..9368dcd9e 100644
--- a/default.nix
+++ b/default.nix
@@ -1,19 +1,12 @@
-import <nixpkgs/nixos/lib/eval-config.nix> {
- modules = [
- (import <nixpkgs/nixos/lib/from-env.nix> "NIXOS_CONFIG" <nixos-config>)
- ];
-}
-//
-{
+import <nixpkgs/nixos> {} // rec {
lib = import ./lib;
- systems = with import ./lib; let
- ns = getEnv "LOGNAME";
+ systems = with lib; let
+ namespace = getEnv "LOGNAME";
+ systemsDir = <stockholm> + "/${namespace}/1systems";
in
genAttrs
- (attrNames (filterAttrs (_: eq "directory") (readDir (<stockholm> + "/${ns}/1systems"))))
- (name: let
- config = import (<stockholm> + "/${ns}/1systems/${name}/config.nix");
- in import <nixpkgs/nixos/lib/eval-config.nix> {
- modules = [ config ];
+ (attrNames (filterAttrs (_: eq "directory") (readDir systemsDir)))
+ (name: import <nixpkgs/nixos> {
+ configuration = import (systemsDir + "/${name}/config.nix");
});
}