Something went wrong. Try again.
A nixos config repository
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344# Host configuration to build; defaults to this machine's hostnamehost := `hostname`# List recipes[private]@default: just --list --unsorted# Update the flake inputsupdate *args: nix flake update {{args}}# Evaluate every host configurationcheck *args: #!/usr/bin/env bash set -uo pipefail if ! hosts=$(nix eval --raw .#nixosConfigurations --apply 'cfgs: builtins.concatStringsSep " " (builtins.attrNames cfgs)' 2>/dev/null); then echo "flake does not evaluate (cannot even list hosts):" nix eval .#nixosConfigurations --apply builtins.attrNames 2>&1 \ | grep -iE "error:|syntax|undefined|missing|attribute '" | head -6 | sed 's/^/ /' exit 1 fi rc=0 for h in $hosts; do printf '%-20s ' "$h" if err=$(nix eval --raw ".#nixosConfigurations.$h.config.system.build.toplevel.drvPath" {{args}} 2>&1 >/dev/null); then echo "ok" else echo "FAIL" printf '%s\n' "$err" | grep -iE "error:|syntax|undefined|missing|attribute '" | head -4 | sed 's/^/ /' rc=1 fi done exit $rc# Check the flake works but don't activate itbuild *args: nixos-rebuild build --flake .#{{host}} {{args}}# Build the flake and activate it[arg("next-boot", short="b", long="next-boot", value="true", help="switch on the next boot")]switch next-boot="false" *args: sudo nixos-rebuild {{ if next-boot == "true" {"boot"} else {"switch"} }} --flake .#{{host}} {{args}}