Auto generate sops entries for users.
This commit is contained in:
parent
fc9cbc6a0c
commit
e06910f8eb
2 changed files with 5 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, fn, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -43,6 +43,10 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
sops.secrets = (fn.sopsHelper
|
||||||
|
(user: "users/${user.name}/password")
|
||||||
|
config.machine.administrators
|
||||||
|
{ neededForUsers = true; });
|
||||||
users = {
|
users = {
|
||||||
mutableUsers = false;
|
mutableUsers = false;
|
||||||
users = listToAttrs (map administrators config.machine.administrators);
|
users = listToAttrs (map administrators config.machine.administrators);
|
||||||
|
|
|
@ -7,7 +7,5 @@
|
||||||
keyFile = "/var/lib/sops-nix/key.txt";
|
keyFile = "/var/lib/sops-nix/key.txt";
|
||||||
generateKey = true;
|
generateKey = true;
|
||||||
};
|
};
|
||||||
# TODO: auto loop over users
|
|
||||||
secrets."users/derped/password".neededForUsers = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue