Use Colmena's experimental flake-eval feature
Don't extract sops keys as root
This commit is contained in:
parent
842d2afbc0
commit
a29d10e507
5 changed files with 139 additions and 30 deletions
|
@ -60,12 +60,10 @@
|
|||
if user == "root"
|
||||
then "/root"
|
||||
else "/home/${user}";
|
||||
maybeSudo = lib.optional (user == "root") "sudo";
|
||||
sops = lib.getExe pkgs.sops;
|
||||
in {
|
||||
name = "${user}-sops-age-key";
|
||||
value = {
|
||||
keyCommand = maybeSudo ++ ["nix" "run" "nixpkgs#sops" "--" "--extract" "[\"sops_age_key\"]" "-d" (builtins.toString sopsFile)];
|
||||
keyCommand = ["nix" "run" "nixpkgs#sops" "--" "--extract" "[\"sops_age_key\"]" "-d" (builtins.toString sopsFile)];
|
||||
name = "keys.txt";
|
||||
destDir = "${homeDirectory}/.config/sops/age";
|
||||
inherit user;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue