Gen 423: Converted shell scripts into nix files
This commit is contained in:
19
glasshouse-laptop/home/scripts/nixswitch.nix
Normal file
19
glasshouse-laptop/home/scripts/nixswitch.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ pkgs }:
|
||||
|
||||
{
|
||||
nixswitch = pkgs.writeShellScriptBin "nixswitch" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
scheck && runbg aplay ~/media/sound/sys/nixswitch-start.wav
|
||||
builtin cd "$HOME/sysflakes" || exit
|
||||
|
||||
nix flake update
|
||||
sudo nixos-rebuild switch --flake "$HOME/sysflakes#glasshouse-laptop"
|
||||
if [ $? -eq 0 ]; then
|
||||
scheck && runbg aplay ~/media/sound/sys/update.wav
|
||||
else
|
||||
scheck && runbg aplay ~/media/sound/sys/error.wav
|
||||
fi
|
||||
builtin cd "$OLDPWD" || exit
|
||||
'');
|
||||
}
|
||||
Reference in New Issue
Block a user