mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-14 03:42:56 +00:00
23 lines
516 B
Nix
23 lines
516 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
|
|
'';
|
|
};
|
|
}
|