Migrate to Snowfall (#1)

Reviewed-on: #1
Co-authored-by: Evan Reichard <evan@reichard.io>
Co-committed-by: Evan Reichard <evan@reichard.io>
This commit was merged in pull request #1.
This commit is contained in:
2025-04-21 00:56:53 +00:00
committed by evan
parent 72ba8ddf59
commit cf0fa75058
118 changed files with 3590 additions and 1571 deletions

View File

@@ -1,7 +1,9 @@
#!/bin/sh
export NIX_CONFIG="experimental-features = nix-command flakes"
function cmd_image() {
local usage="Usage: $0 image --name <image-name>"
local usage="Usage: $0 image --name <image-name> [--remote]"
local name=""
local remote=false
@@ -29,14 +31,13 @@ function cmd_image() {
# Validate Config Exists
if ! nix eval --json --impure \
--experimental-features "nix-command flakes" \
".#packages.x86_64-linux" \
".#qcowConfigurations" \
--apply "s: builtins.hasAttr \"$name\" s" 2>/dev/null | grep -q "true"; then
echo "Error: NixOS Generator Config '$name' not found"
exit 1
fi
build_args=(".#packages.x86_64-linux.$name")
build_args=(".#qcowConfigurations.$name")
if [ "$remote" = true ]; then
build_args+=("-j0")
fi
@@ -73,7 +74,6 @@ function cmd_install() {
# Validate Config Exists
if ! nix eval --json --impure \
--experimental-features "nix-command flakes" \
".#nixosConfigurations" \
--apply "s: builtins.hasAttr \"$name\" s" 2>/dev/null | grep -q "true"; then
echo "Error: NixOS configuration '$name' not found"
@@ -82,8 +82,7 @@ function cmd_install() {
# Validate mainDiskID Exists
if ! disk_id=$(nix eval --raw --impure \
--experimental-features "nix-command flakes" \
".#nixosConfigurations.$name.config.mainDiskID" 2>/dev/null); then
".#nixosConfigurations.$name.config.disko.devices.disk.main.device" 2>/dev/null); then
echo "Error: mainDiskID not defined for configuration '$name'"
exit 1
fi