Use actual encryption passwords
This commit is contained in:
parent
54ec1fc9ba
commit
f20678d134
4 changed files with 15 additions and 5 deletions
|
@ -64,6 +64,7 @@ fi
|
|||
|
||||
mountpoint="/mnt/nixos"
|
||||
nix_flakes_cmd="nix --extra-experimental-features nix-command --extra-experimental-features flakes"
|
||||
luks_pass_path="luks/$(basename ${profile})"
|
||||
|
||||
set -x
|
||||
|
||||
|
@ -73,8 +74,15 @@ sudo mkdir -p "$mountpoint"
|
|||
# Not great, but fixable with flakes I guess
|
||||
sudo ./add_channels.sh
|
||||
|
||||
# Load encryption password
|
||||
luks_pass_file="$(mktemp --suffix="luks_password")"
|
||||
pass $luks_pass_path | head -n1 | tr -d '\n' > $luks_pass_file
|
||||
|
||||
# Format or mount disk
|
||||
sudo $nix_flakes_cmd run github:nix-community/disko -- --root-mountpoint "$mountpoint" --mode "$disko_mode" "$disko_config"
|
||||
sudo $nix_flakes_cmd run github:nix-community/disko -- --root-mountpoint "$mountpoint" --mode "$disko_mode" --argstr passwordFile "$luks_pass_file" "$disko_config"
|
||||
|
||||
# Unload encryption password
|
||||
rm "$luks_pass_file"
|
||||
|
||||
# Generate hardware-config.nix
|
||||
sudo nixos-generate-config --no-filesystems --root "$mountpoint"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue