move user namespaces into "users" attribute

IOW get ${user-name} -> get users.${user-name}
This commit is contained in:
tv 2015-10-19 21:20:38 +02:00
parent dc52c4b988
commit 5fdae43a99
3 changed files with 15 additions and 12 deletions

View File

@ -3,7 +3,7 @@
# make infest system=foo [target=bar]
# make [deploy] system=foo [target=bar]
# make [deploy] systems='foo bar'
# make eval get=tv.wu.config.time.timeZone [filter=json]
# make eval get=users.tv.wu.config.time.timeZone [filter=json]
#
.ONESHELL:

View File

@ -25,16 +25,18 @@ in with klib; let
kpkgs // upkgs;
};
out =
{ inherit (eval {}) config options pkgs; } //
lib.mapAttrs
out = {
inherit (eval {}) config options pkgs;
krebs = import ./krebs;
users = lib.mapAttrs
(name: _:
if builtins.pathExists (nspath name "default.nix")
then import (nspath name "default.nix")
else import-1systems (nspath name "1systems"))
(lib.filterAttrs
(n: t: !lib.hasPrefix "." n && t == "directory")
(n: t: !lib.hasPrefix "." n && t == "directory" && n != "krebs")
(builtins.readDir ./.));
};
eval = path: import <nixpkgs/nixos/lib/eval-config.nix> {
modules = [

View File

@ -132,7 +132,7 @@
stockholm = import ../. current;
get-config = system:
stockholm.${current-user-name}.${system}.config
stockholm.users.${current-user-name}.${system}.config
or (abort "unknown system: ${system}");
doc = s:
@ -181,6 +181,7 @@
--profile ${lib.shell.escape config.krebs.build.profile} \
--set \
-A ${lib.escapeShellArg (lib.concatStringsSep "." [
"users"
config.krebs.build.user.name
config.krebs.build.host.name
"system"