Auto generate sops entries for users.

This commit is contained in:
Kevin Baensch 2023-08-28 22:05:42 +02:00
parent fc9cbc6a0c
commit e06910f8eb
Signed by: derped
GPG key ID: C0F1D326C7626543
2 changed files with 5 additions and 3 deletions

View file

@ -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);

View file

@ -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;
}; };
} }