add help for nixos-edit

This commit is contained in:
Daniella / Tove 2024-10-19 03:37:32 +02:00
parent 9845f71967
commit 6c9f1b8a02

View file

@ -3,6 +3,19 @@ with import <nixpkgs> {};
pkgs.writeShellScriptBin "nixos-edit" '' pkgs.writeShellScriptBin "nixos-edit" ''
#!/bin/sh #!/bin/sh
if [ "$1" = "help" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
echo "nixos-edit by tudbut"
echo
echo "supports commands:"
echo " - pull -- pulls the changes and switches to them"
echo " - edit -- edits the OS, pushes it, and switches"
echo " - update -- update the system"
echo " - init -- initialize the system (only run once)"
echo
echo "edit is the default mode."
exit 0
fi
if [ "$1" = "init" ] ; then if [ "$1" = "init" ] ; then
if [ "$(whoami)" = root ] ; then if [ "$(whoami)" = root ] ; then
echo "re-executing as tudbut" echo "re-executing as tudbut"