feat: add buildthis bud command

This commit is contained in:
Infinidoge 2021-10-05 08:57:57 -04:00
parent 3312040d74
commit 6d3c611d71
2 changed files with 16 additions and 0 deletions

9
bud/buildthis.bash Normal file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
attr="$FLAKEROOT#$HOST"
if [ -x /run/wrappers/bin/sudo ]; then
export PATH=/run/wrappers/bin:$PATH
sudo nixos-rebuild --flake "$attr" "${@:2}"
else
nixos-rebuild --flake "$attr" "${@:2}"
fi

View file

@ -6,5 +6,12 @@
help = "Copy the desired template to DEST"; help = "Copy the desired template to DEST";
script = ./get.bash; script = ./get.bash;
}; };
buildthis = {
writer = budUtils.writeBashWithPaths [ nixUnstable nixos-rebuild git coreutils mercurial ];
synopsis = "buildthis (switch|boot|test)";
help = "Shortcut for nixos-rebuild using the current hostname";
script = ./buildthis.bash;
};
}; };
} }