From 9c97865f15a07b910a13de6ae1d6ab6b14ade9a9 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Nov 2018 11:27:47 +0100 Subject: default.nix: simplify system evaluations --- default.nix | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index 5ae8e399..9368dcd9 100644 --- a/default.nix +++ b/default.nix @@ -1,19 +1,12 @@ -import { - modules = [ - (import "NIXOS_CONFIG" ) - ]; -} -// -{ +import {} // rec { lib = import ./lib; - systems = with import ./lib; let - ns = getEnv "LOGNAME"; + systems = with lib; let + namespace = getEnv "LOGNAME"; + systemsDir = + "/${namespace}/1systems"; in genAttrs - (attrNames (filterAttrs (_: eq "directory") (readDir ( + "/${ns}/1systems")))) - (name: let - config = import ( + "/${ns}/1systems/${name}/config.nix"); - in import { - modules = [ config ]; + (attrNames (filterAttrs (_: eq "directory") (readDir systemsDir))) + (name: import { + configuration = import (systemsDir + "/${name}/config.nix"); }); } -- cgit v1.2.3