summary refs log tree commit diff
path: root/mkiso.sh
blob: 9815e13f9222b9b1f8ed60f37f8518e971646e8e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p git nixos-install-tools nix-output-monitor
if [ $# -ne 1 ]; then
    echo "Usage: $0 <config>"
    echo "NOTE: hardware config will be generated from root!"
    echo "Defined configs:"
    cat flake.nix | grep '.lib.nixosSystem' | sed 's/ =.*//' | sed 's/^[ \t]*//;s/[ \t]*$//' | while read cfg; do echo " - $cfg"; done
    exit 1
fi

CONFIG=$1

DERIVATION=".#nixosConfigurations.${CONFIG}.config.system.build.isoImage"
EXTRA_NIX_FLAGS="-L --accept-flake-config"
EXTRA_NIXOS_REBUILD_FLAGS="--use-remote-sudo --offline --fast"

nom build $DERIVATION $EXTRA_NIX_FLAGS || exit 1