feat: add buildthis bud command
This commit is contained in:
parent
3312040d74
commit
6d3c611d71
2 changed files with 16 additions and 0 deletions
9
bud/buildthis.bash
Normal file
9
bud/buildthis.bash
Normal 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
|
|
@ -6,5 +6,12 @@
|
|||
help = "Copy the desired template to DEST";
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue