blob: 9432a802d13d1a9e2efd044dc8280c4b4e9a2cb1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/bin/sh
set -eo pipefail
DIR=$(dirname $0)
D=$(mktemp -du)
ROOT="$DIR/roots/$(hostname).nix"
function build {
NIXPKGS_ALLOW_UNFREE=1 \
nix build -f '<nixpkgs/nixos>' config.system.build \
-I nixos-config="$ROOT" \
-I "nixpkgs=$DIR/nixpkgs" \
-I "nixpkgs-overlays=$DIR/overlays" \
-I "home-manager=$DIR/home-manager" \
--out-link "$D"
}
function switch {
build $ROOT
$D-18/activate
}
case "$1" in
-s* | --switch*) switch ;;
*) build ;;
esac
rm -rf $D*
|