nixos-config-master/.envrc.example

41 lines
1.0 KiB
Plaintext

# Development environment configuration
export FLAKE_ROOT="$PWD"
# Installation target configuration
export TARGET_HOST="${TARGET_HOST:-""}" # e.g., "steamdeck" or "surface"
export TARGET_USER="${TARGET_USER:-""}" # e.g., "jeirmeister"
# Enable flakes and unfree packages for development shell
export NIX_CONFIG="
experimental-features = nix-command flakes
allow-unfree = true
accept-flake-config = true
"
# Development shell helper functions
build_system() {
if [ -z "$TARGET_HOST" ]; then
echo "ERROR: TARGET_HOST not set"
return 1
fi
nixos-rebuild build --flake ".#${TARGET_HOST}"
}
switch_system() {
if [ -z "$TARGET_HOST" ]; then
echo "ERROR: TARGET_HOST not set"
return 1
fi
sudo nixos-rebuild switch --flake ".#${TARGET_HOST}"
}
update_home() {
if [ -z "$TARGET_HOST" ] || [ -z "$TARGET_USER" ]; then
echo "ERROR: TARGET_HOST and TARGET_USER must be set"
return 1
fi
home-manager switch --flake ".#${TARGET_USER}@${TARGET_HOST}"
}
# Load the development shell
use flake