(desktop) Gen 490: split nixcommit into two scripts, one for committing one for pushing. also renamed nixswitch to rebuild
This commit is contained in:
20
modules/home/scripts/nix/rebuild.nix
Normal file
20
modules/home/scripts/nix/rebuild.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ host, self, pkgs }:
|
||||
|
||||
|
||||
pkgs.writeShellScriptBin "rebuild" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
|
||||
set -e
|
||||
pushd "$HOME/sysflakes"
|
||||
|
||||
nix flake update
|
||||
git diff
|
||||
sudo nixos-rebuild switch --flake "$HOME/sysflakes#${host}"
|
||||
if [ $? -eq 0 ]; then
|
||||
scheck && runbg aplay ${self}/media/sound/update.wav
|
||||
else
|
||||
scheck && runbg aplay ${self}/media/sound/error.wav
|
||||
fi
|
||||
popd
|
||||
'')
|
||||
Reference in New Issue
Block a user