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 infest system=foo [target=bar]
|
||||||
# make [deploy] system=foo [target=bar]
|
# make [deploy] system=foo [target=bar]
|
||||||
# make [deploy] systems='foo 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:
|
.ONESHELL:
|
||||||
|
22
default.nix
22
default.nix
@ -25,16 +25,18 @@ in with klib; let
|
|||||||
kpkgs // upkgs;
|
kpkgs // upkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
out =
|
out = {
|
||||||
{ inherit (eval {}) config options pkgs; } //
|
inherit (eval {}) config options pkgs;
|
||||||
lib.mapAttrs
|
krebs = import ./krebs;
|
||||||
(name: _:
|
users = lib.mapAttrs
|
||||||
if builtins.pathExists (nspath name "default.nix")
|
(name: _:
|
||||||
then import (nspath name "default.nix")
|
if builtins.pathExists (nspath name "default.nix")
|
||||||
else import-1systems (nspath name "1systems"))
|
then import (nspath name "default.nix")
|
||||||
(lib.filterAttrs
|
else import-1systems (nspath name "1systems"))
|
||||||
(n: t: !lib.hasPrefix "." n && t == "directory")
|
(lib.filterAttrs
|
||||||
(builtins.readDir ./.));
|
(n: t: !lib.hasPrefix "." n && t == "directory" && n != "krebs")
|
||||||
|
(builtins.readDir ./.));
|
||||||
|
};
|
||||||
|
|
||||||
eval = path: import <nixpkgs/nixos/lib/eval-config.nix> {
|
eval = path: import <nixpkgs/nixos/lib/eval-config.nix> {
|
||||||
modules = [
|
modules = [
|
||||||
|
@ -132,7 +132,7 @@
|
|||||||
stockholm = import ../. current;
|
stockholm = import ../. current;
|
||||||
|
|
||||||
get-config = system:
|
get-config = system:
|
||||||
stockholm.${current-user-name}.${system}.config
|
stockholm.users.${current-user-name}.${system}.config
|
||||||
or (abort "unknown system: ${system}");
|
or (abort "unknown system: ${system}");
|
||||||
|
|
||||||
doc = s:
|
doc = s:
|
||||||
@ -181,6 +181,7 @@
|
|||||||
--profile ${lib.shell.escape config.krebs.build.profile} \
|
--profile ${lib.shell.escape config.krebs.build.profile} \
|
||||||
--set \
|
--set \
|
||||||
-A ${lib.escapeShellArg (lib.concatStringsSep "." [
|
-A ${lib.escapeShellArg (lib.concatStringsSep "." [
|
||||||
|
"users"
|
||||||
config.krebs.build.user.name
|
config.krebs.build.user.name
|
||||||
config.krebs.build.host.name
|
config.krebs.build.host.name
|
||||||
"system"
|
"system"
|
||||||
|
Loading…
Reference in New Issue
Block a user