Attempt to fix some random bugs
All checks were successful
/ dev-shell (push) Successful in 30s
/ rust-packages (push) Successful in 37s
/ check (push) Successful in 1m13s
/ terraform-providers (push) Successful in 1m1s
/ systems (push) Successful in 3m34s

This commit is contained in:
Kaare Hoff Skovgaard 2025-07-19 22:46:51 +02:00
parent 293dbdab94
commit ac1c6adc75
Signed by: khs
GPG key ID: C7D890804F01E9F0

View file

@ -15,14 +15,21 @@ let
pkgs.uutils-coreutils-noprefix
];
text = ''
owner_id="$(stat -c "%u" /run/unix-users/khs)"
group_id="$(stat -c "%g" /run/unix-users/khs)"
if [[ "$owner_id" != "0" || "$group_id" != "0" ]]; then
>&2 echo "Not setting password due to bad ownership"
exit 1
fi
hashed_passwd="$(cat /run/unix-users/khs)"
usermod --password "$hashed_passwd" khs
'';
};
in
{
config = lib.mkIf cfg.enable {
khscodes.infrastructure.vault-server-approle.policy = lib.mkIf (userExists "khs") {
config = lib.mkIf (cfg.enable && (userExists "khs")) {
khscodes.infrastructure.vault-server-approle.policy = {
"unix-users/data/khs/password" = {
capabilities = [ "read" ];
};