l blue-host: dry-build blue first

This commit is contained in:
lassulus 2018-11-27 01:00:59 +01:00
parent 304059b1da
commit a1c261d61b

View File

@ -99,14 +99,15 @@ in {
environment.systemPackages = [ environment.systemPackages = [
(pkgs.writeDashBin "start-blue" '' (pkgs.writeDashBin "start-blue" ''
set -ef set -ef
if ping -c1 blue.r >/dev/null; then
echo 'blue is already running. bailing out'
exit 23
fi
if ! $(mount | ${pkgs.gnugrep}/bin/grep -qi '^encfs on /var/lib/containers/blue'); then if ! $(mount | ${pkgs.gnugrep}/bin/grep -qi '^encfs on /var/lib/containers/blue'); then
${pkgs.encfs}/bin/encfs --public /var/lib/containers/.blue /var/lib/containers/blue ${pkgs.encfs}/bin/encfs --public /var/lib/containers/.blue /var/lib/containers/blue
fi fi
nixos-container start blue nixos-container start blue
nixos-container run blue -- nixos-rebuild -I /var/src dry-build
if ping -c1 blue.r >/dev/null; then
echo 'blue is already running. bailing out'
exit 23
fi
nixos-container run blue -- nixos-rebuild -I /var/src switch nixos-container run blue -- nixos-rebuild -I /var/src switch
'') '')
]; ];