From bfe0723728ae2d995b99f22fe9783a34889b1828 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 1 Oct 2015 01:48:15 +0200 Subject: move config scripts to krebs --- default.nix | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index 1c3341ba..7f3f621b 100644 --- a/default.nix +++ b/default.nix @@ -1,36 +1,29 @@ -{ user-name, host-name }: +{ current-date +, current-host-name +, current-user-name +}: let lib = import ; krebs-modules-path = ./krebs/3modules; krebs-pkgs-path = ./krebs/5pkgs; - user-modules-path = ./. + "/${user-name}/3modules"; - user-pkgs-path = ./. + "/${user-name}/5pkgs"; + user-modules-path = ./. + "/${current-user-name}/3modules"; + user-pkgs-path = ./. + "/${current-user-name}/5pkgs"; out = - (lib.mapAttrs (k: v: mk-namespace (./. + "/${k}")) + (lib.mapAttrs + (k: v: + if builtins.pathExists (./. + "/${k}/1systems") + then mk-namespace (./. + "/${k}") + else import (./. + "/${k}")) (lib.filterAttrs - (k: v: !lib.hasPrefix "." k && v == "directory" && - builtins.pathExists (./. + "/${k}/1systems")) + (k: v: !lib.hasPrefix "." k && v == "directory") (builtins.readDir ./.))); eval = path: import { system = builtins.currentSystem; modules = [ - ({ config, ... }: - with import ./krebs/4lib { inherit lib; }; - { - options.krebs.exec.host = mkOption { - type = types.host; - default = config.krebs.hosts.${host-name}; - }; - options.krebs.exec.user = mkOption { - type = types.user; - default = config.krebs.users.${user-name}; - }; - } - ) path krebs-modules-path user-modules-path -- cgit v1.2.3