Add locking via flock(1) #25

Merged
MatthewCroughan merged 2 commits from mc/flocking into master 2022-09-12 17:58:39 +00:00
Showing only changes of commit 1a19e15736 - Show all commits

View file

@ -52,10 +52,10 @@
'' + (if hermetic then ''
echo "🤞 Activating configuration hermetically on ${machine} via ssh:"
( set -x; ${nix} copy --derivation ${nixos-rebuild} --to ssh://${user}@${host} )
( set -x; ${openssh} -t ${user}@${host} 'sudo nix-store --realise ${nixos-rebuild} && sudo ${nixos-rebuild} ${switch} --flake ${flake}#${machine}' )
( set -x; ${openssh} -t ${user}@${host} "sudo nix-store --realise ${nixos-rebuild} && sudo ${nixos-rebuild} ${switch} --flake ${flake}#${machine}" )
'' else ''
echo "🤞 Activating configuration non-hermetically on ${machine} via ssh:"
( set -x; ${openssh} -t ${user}@${host} 'sudo nixos-rebuild ${switch} --flake ${flake}#${machine}' )
( set -x; ${openssh} -t ${user}@${host} "sudo nixos-rebuild ${switch} --flake ${flake}#${machine}" )
'')
else ''
echo "🔨 Building system closure locally, copying it to remote store and activating it:"