dotfiles/modules/nixos/services/identity.nix
Noah Masur 0618fc3962 try binding to wait for identity service to complete
and see if remainafterexit fixes one of the issues
2024-03-30 13:01:34 -04:00

23 lines
517 B
Nix

{ config, ... }: {
# Wait for secret to be placed on the machine
systemd.services.wait-for-identity = {
description = "Wait until identity file exists on the machine";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
script = ''
for i in $(seq 1 10); do
if [ -f ${config.identityFile} ]; then
echo "Identity file found."
exit 0
fi
sleep 6
done
'';
};
}