Files
shed/modules/home/scripts/nix/rebuild.nix
2024-10-18 02:07:09 -04:00

18 lines
389 B
Nix

{
host,
self,
pkgs,
}:
pkgs.writeShellScriptBin "rebuild" ''
#!/run/current-system/sw/bin/bash
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
set -e
sudo nixos-rebuild switch --flake "$HOME/.sysflake#${host}"
if [ $? -eq 0 ]; then
scheck && runbg aplay ${self}/media/sound/update.wav
else
scheck && runbg aplay ${self}/media/sound/error.wav
fi
''