add custom_command support to `rebuild`

since `netbox` has some weird requirements, add a custom_command option
for `rebuild`.
This commit is contained in:
stupidcomputer 2024-07-22 14:21:02 -05:00
parent b834f6e76a
commit 90e4234f2a
2 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1 @@
sudo nixos-rebuild --flake . switch --impure -I nixos-config=./

View File

@ -1,4 +1,11 @@
#!/bin/sh
cd ~/dot_testing
if [ -f "boxes/$(hostname)/custom_command" ]; then
eval "$(cat boxes/$(hostname)/custom_command)"
exit
fi
if [ -f "flake.nix" ]; then
sudo nixos-rebuild --flake . switch $@
else