l sync-containers3: create dir, fix symlink

This commit is contained in:
lassulus 2023-01-02 18:47:14 +01:00
parent 767c6fbd14
commit d5a4c2181d

View File

@ -50,7 +50,8 @@ in {
wantedBy = [ "multi-user.target" ];
serviceConfig.ExecStart = pkgs.writers.writeDash "autoswitch" ''
set -efu
ln -frs /var/state/var_src /var/src
mkdir -p /var/state/var_src
ln -Tfrs /var/state/var_src /var/src
if test -e /var/src/nixos-config; then
/run/current-system/sw/bin/nixos-rebuild -I /var/src switch || :
fi