l blue-host: add start/stop scripts
This commit is contained in:
parent
0328c75a12
commit
5e3955c79a
@ -20,4 +20,23 @@ with import <stockholm/lib>;
|
||||
hostAddress = "10.233.2.9";
|
||||
localAddress = "10.233.2.10";
|
||||
};
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeDashBin "start-blue" ''
|
||||
set -ef
|
||||
if ping -c1 blue.r; 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
|
||||
${pkgs.encfs}/bin/encfs --public /var/lib/containers/.blue /var/lib/containers/blue
|
||||
fi
|
||||
nixos-container start blue
|
||||
nixos-container run blue -- nixos-rebuild -I /var/src switch
|
||||
'')
|
||||
(pkgs.writeDashBin "stop-blue" ''
|
||||
set -ef
|
||||
nixos-container stop blue
|
||||
fusermount -u /var/lib/containers/blue
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user