move user namespaces into "users" attribute
IOW get ${user-name} -> get users.${user-name}
This commit is contained in:
parent
dc52c4b988
commit
5fdae43a99
2
Makefile
2
Makefile
@ -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:
|
||||
|
10
default.nix
10
default.nix
@ -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 = [
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user