diff --git a/justfile b/justfile index 60f43e4..0406689 100644 --- a/justfile +++ b/justfile @@ -1,6 +1,9 @@ build: sudo echo "sudo check..." && sudo nixos-rebuild --log-format internal-json -v switch --flake .# --show-trace |& nom --json +boot: + sudo echo "sudo check..." && sudo nixos-rebuild --log-format internal-json -v boot --flake .# --show-trace |& nom --json + run: nix-repl -f flake:nixpkgs @@ -15,7 +18,19 @@ clean: sudo nix-store --optimise setup: - echo "just test" >> ./.git/hooks/pre-commit && chmod +x ./.git/hooks/pre-commit + #!/run/current-system/sw/bin/bash -e + if [ -s ./.git/hooks/pre-commit ]; then + read -p $"This file already contains the following text: + $(<./.git/hooks/pre-commit) + Do you want to add the test hook (y/N)? (This will NOT delete data)" choice + case "$choice" in + y|Y ) echo "just test" >> ./.git/hooks/pre-commit && chmod +x ./.git/hooks/pre-commit && echo "Added test hook to pre-commit.";; + * ) echo "No test added to pre-commit.";; + esac + else + echo "just test" >> ./.git/hooks/pre-commit && chmod +x ./.git/hooks/pre-commit + fi + push: git pull diff --git a/pkgs/rebuild-no-inhibit/default.nix b/pkgs/rebuild-no-inhibit/default.nix index ab38581..f421342 100644 --- a/pkgs/rebuild-no-inhibit/default.nix +++ b/pkgs/rebuild-no-inhibit/default.nix @@ -18,7 +18,11 @@ writeShellApplication git clone https://codeberg.org/Lillian-Violet/NixOS-Config.git ./rebuild pushd ./rebuild > /dev/null echo "NixOS Rebuilding..." - just build + if ["''$HOSTNAME" = shodan]; then + just boot + else + just build + fi popd > /dev/null echo "Cleaning up repository in '/tmp/rebuild'..." rm -rf ./rebuild