commit 9b5fc2a8786defb6a2302bd9bde38499d7494d59 parent 2523eedd0a78c76c5ed688d6cc2ce4dd676e8824 Author: Vincent Demeester <vincent@sbr.pm> Date: Thu, 26 Nov 2020 18:28:01 +0100 Remove hack folder Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | Makefile | | | 6 | +++--- |
D | hack/system | | | 57 | --------------------------------------------------------- |
R | hack/bootstrap.sh -> tools/tmp/bootstrap.sh | | | 0 | |
R | hack/create-vm.sh -> tools/tmp/create-vm.sh | | | 0 | |
R | hack/install.sh -> tools/tmp/install.sh | | | 0 | |
R | hack/installer_configuration.nix -> tools/tmp/installer_configuration.nix | | | 0 | |
R | hack/iso.nix -> tools/tmp/iso.nix | | | 0 |
7 files changed, 3 insertions(+), 60 deletions(-)
diff --git a/Makefile b/Makefile @@ -41,15 +41,15 @@ home-switch: secrets .PHONY: build build: secrets - ./hack/system build + ./bin/system build .PHONY: nixos-dry-build dry-build: secrets setup - ./hack/system dry-build + ./bin/system dry-build .PHONY: switch switch: secrets - ./hack/system switch + ./bin/system switch .PHONY: install-hooks install-hooks: diff --git a/hack/system b/hack/system @@ -1,57 +0,0 @@ -#! /usr/bin/env bash -set -o pipefail -o noclobber -o nounset - -WORK_DIR=${WORK_DIR-} -if [[ -z "${WORK_DIR}" ]]; then - WORK_DIR="$(mktemp --tmpdir -u nix-config-sync.XXXXXXXXXX)" - # shellcheck disable=2064 - trap "rm -rf '$WORK_DIR'" EXIT -fi -function error() { - local red - local reset - red="$(tput -Txterm setaf 1)" - reset="$(tput -Txterm sgr0)" - - printf "%s%s%s\n" "$red" "$*" "$reset" - exit 1 -} - -function dry-build() { - [ "$#" -eq 0 ] || error "build" - local machine - machine="$(hostname)" - unset NIX_PATH - nix build systems.nix --show-trace --dry-run --out-link "$WORK_DIR" "$machine" || - error "Failed to build system" -} - -function build() { - [ "$#" -eq 0 ] || error "build" - local machine - machine="$(hostname)" - unset NIX_PATH - nix build -f systems.nix --show-trace --out-link "$WORK_DIR" "$machine" || - error "Failed to build system" -} - -function switch() { - [ "$#" -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" "switch" || - error "Failed to activate system" -} - -function main() { - for target in $@; do - $target - done - exit 0 -} - -main "$@" diff --git a/hack/bootstrap.sh b/tools/tmp/bootstrap.sh diff --git a/hack/create-vm.sh b/tools/tmp/create-vm.sh diff --git a/hack/install.sh b/tools/tmp/install.sh diff --git a/hack/installer_configuration.nix b/tools/tmp/installer_configuration.nix diff --git a/hack/iso.nix b/tools/tmp/iso.nix