feat: installer works with a local copy
Some checks failed
/ check (push) Has been cancelled

This commit is contained in:
Daniel Flanagan 2025-02-20 12:54:31 -06:00
parent 59b16d8544
commit 8410f63cc9

View file

@ -10,6 +10,11 @@ pkgs.writeShellApplication {
gawk gawk
]; ];
text = '' text = ''
dir="$(mktemp -d)"
cd "$dir"
git clone https://git.lyte.dev/lytedev/nix
cd nix
read -s -r -p 'Disk Encryption Password:' pass1 read -s -r -p 'Disk Encryption Password:' pass1
echo echo
read -s -r -p 'Disk Encryption Password (Again):' pass2 read -s -r -p 'Disk Encryption Password (Again):' pass2
@ -18,8 +23,8 @@ pkgs.writeShellApplication {
echo "error: disk encryption passwords did not match!" echo "error: disk encryption passwords did not match!"
exit 1 exit 1
fi fi
nixos_host="$(nix --extra-experimental-features 'nix-command flakes' eval --accept-flake-config --json git+https://git.lyte.dev/lytedev/nix#nixosConfigurations --apply 'builtins.attrNames' | jq -r .[] | fzf --prompt 'Select NixOS configuration')" nixos_host="$(nix --extra-experimental-features 'nix-command flakes' eval --accept-flake-config --json .#nixosConfigurations --apply 'builtins.attrNames' | jq -r .[] | fzf --prompt 'Select NixOS configuration')"
partition_scheme="$(nix --extra-experimental-features 'nix-command flakes' eval --accept-flake-config --json git+https://git.lyte.dev/lytedev/nix#diskoConfigurations --apply 'builtins.attrNames' | jq -r .[] | fzf --prompt 'Select disk partition scheme (must match NixOS configuration!)')" partition_scheme="$(nix --extra-experimental-features 'nix-command flakes' eval --accept-flake-config --json .#diskoConfigurations --apply 'builtins.attrNames' | jq -r .[] | fzf --prompt 'Select disk partition scheme (must match NixOS configuration!)')"
disk_path="/dev/$(lsblk -d --raw | tail -n +2 | fzf --prompt 'Select local disk device' | awk '{print $1}')" disk_path="/dev/$(lsblk -d --raw | tail -n +2 | fzf --prompt 'Select local disk device' | awk '{print $1}')"
echo "$pass1" | tr -d "\n" > /tmp/secret.key echo "$pass1" | tr -d "\n" > /tmp/secret.key
@ -33,14 +38,14 @@ pkgs.writeShellApplication {
--extra-experimental-features nix-command \ --extra-experimental-features nix-command \
--extra-experimental-features flakes \ --extra-experimental-features flakes \
github:nix-community/disko -- \ github:nix-community/disko -- \
--flake 'git+https://git.lyte.dev/lytedev/nix#$partition_scheme' \ --flake '.#$partition_scheme' \
--mode disko \ --mode disko \
--arg disk '\"$disk_path\"'" --arg disk '\"$disk_path\"'"
nix-shell --packages git \ nix-shell --packages git \
--run "sudo nixos-install \ --run "sudo nixos-install \
--no-write-lock-file \ --no-write-lock-file \
--flake 'git+https://git.lyte.dev/lytedev/nix#$nixos_host' \ --flake '.#$nixos_host' \
--option trusted-substituters 'https://cache.nixos.org https://nix.h.lyte.dev' \ --option trusted-substituters 'https://cache.nixos.org https://nix.h.lyte.dev' \
--option trusted-public-keys 'cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= h.lyte.dev-2:te9xK/GcWPA/5aXav8+e5RHImKYMug8hIIbhHsKPN0M='" ''; --option trusted-public-keys 'cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= h.lyte.dev-2:te9xK/GcWPA/5aXav8+e5RHImKYMug8hIIbhHsKPN0M='" '';
} }