From cb654782fa9b8130d056579a7922062a92501b77 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 20 Oct 2015 02:33:58 +0200 Subject: document top-level default.nix --- krebs/default.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'krebs/default.nix') diff --git a/krebs/default.nix b/krebs/default.nix index 6e2aa2f9..daa23cba 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -129,11 +129,15 @@ lib = import ./4lib { lib = import ; } // rec { - stockholm = import ../. current; + stockholm-path = ../.; + + stockholm = import stockholm-path current; + + nspath = ns: p: stockholm-path + "/${ns}/${p}"; get-config = system: stockholm.users.${current-user-name}.${system}.config - or (abort "unknown system: ${system}"); + or (abort "unknown system: ${system}, user: ${current-user-name}"); doc = s: let b = "EOF${builtins.hashString "sha256" s}"; in @@ -160,8 +164,7 @@ inherit current-user-name; }; - config = stockholm.${current-user-name}.${system}.config - or (abort "unknown system: ${system}"); + config = get-config system; nix-path = lib.concatStringsSep ":" @@ -209,8 +212,7 @@ inherit current-user-name; }; - config = stockholm.${current-user-name}.${system}.config - or (abort "unknown system: ${system}"); + config = get-config system; current-host = config.krebs.hosts.${current-host-name}; current-user = config.krebs.users.${current-user-name}; -- cgit v1.2.3