os/pkgs/psos.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
864 B
Nix
Raw Normal View History

2023-01-28 20:49:10 +00:00
self: with self; ''
2021-05-30 19:10:28 +00:00
case $1 in
rebuild)
shift;
exec sudo nixos-rebuild switch --flake "/etc/nixos#installed-host" $@
;;
update)
shift;
cd /etc/nixos
git pull
exec nix flake update
;;
option)
shift;
exec nixos-option -I nixpkgs=/etc/nixos/lib/compat $@
;;
help)
shift;
exec xdg-open http://help.local/
;;
2021-05-30 19:10:28 +00:00
*)
if [[ "$@" != "" ]]; then
echo "Unknown command: psos $@"
echo ""
fi
echo "Usage: psos [COMMAND]"
echo " rebuild Rebuild the configuration and switch to it"
echo " update Pull git and update flake.lock"
echo " option [path] See the current value for an option in the flake config. Example: psos option nix.nixPath"
exit 1
;;
esac
''