commit 1fc2b6576189dbb37946c974e7884296fdc7b7bf parent 2ca6fed6b9559c649f188026207cccaac8490519 Author: Vincent Demeester <vincent@sbr.pm> Date: Fri, 4 Dec 2020 11:57:16 +0100 system: add a boot target… Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | Makefile | | | 4 | ++++ |
M | tools/system/system | | | 12 | ++++++++++++ |
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile @@ -51,6 +51,10 @@ dry-build: secrets setup switch: secrets ./bin/system switch +.PHONY: boot +boot: secrets + ./bin/system boot + .PHONY: install-hooks install-hooks: if [ -e .git ]; then nix-shell -p git --run 'git config core.hooksPath .githooks'; fi diff --git a/tools/system/system b/tools/system/system @@ -47,6 +47,18 @@ function switch() { error "Failed to activate system" } +function boot() { + [ "$#" -eq 0 ] || error "switch" + build + local switch_bin="$WORK_DIR/bin/switch-to-configuration" + sudo nix-env --set \ + --profile "/nix/var/nix/profiles/system" \ + "$WORK_DIR" || + error "Failed to activate profile" + sudo "$switch_bin" "boot" || + error "Failed to activate system" +} + function main() { for target in $@; do $target