Commit 9b5fc2a8786d
Changed files (7)
hack
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 "$@"
hack/bootstrap.sh → tools/tmp/bootstrap.sh
File renamed without changes
hack/create-vm.sh → tools/tmp/create-vm.sh
File renamed without changes
hack/install.sh → tools/tmp/install.sh
File renamed without changes
hack/installer_configuration.nix → tools/tmp/installer_configuration.nix
File renamed without changes
hack/iso.nix → tools/tmp/iso.nix
File renamed without changes
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: