Remove disko format argument

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-02-16 11:14:10 +00:00
parent 8a9d75808a
commit 5eb9766572
7 changed files with 11 additions and 26 deletions

View File

@@ -70,7 +70,7 @@ prepare_disk() {
local disko_mode="$1" local disko_mode="$1"
mkdir -p /mnt mkdir -p /mnt
root=$(mktemp -d /mnt/install.XXXXXX) root=$(mktemp -d /mnt/install.XXXXXX)
disko -m "$disko_mode" --yes-wipe-all-disks --root-mountpoint "$root" "$flake/hosts/$host/format.nix" --arg device "\"$device\"" disko -m "$disko_mode" --yes-wipe-all-disks --root-mountpoint "$root" "$flake/hosts/$host/format.nix"
} }
copy_keys() { copy_keys() {
@@ -109,7 +109,7 @@ finish() {
cleanup() { cleanup() {
rm -f /tmp/installer.key rm -f /tmp/installer.key
if [[ -n "$host" && -n "$device" ]]; then disko -m "unmount" "$flake/hosts/$host/format.nix" --arg device "\"$device\""; fi if [[ -n "$host" ]]; then disko -m "unmount" "$flake/hosts/$host/format.nix"; fi
if [[ -d "$root" ]]; then rmdir "$root"; fi if [[ -d "$root" ]]; then rmdir "$root"; fi
} }
@@ -151,8 +151,6 @@ check_host
check_key check_key
until set_password_file; do echo "Passwords did not match, please try again."; done until set_password_file; do echo "Passwords did not match, please try again."; done
device=$(grep -oP '(?<=device = ")[^"]+' "$flake/hosts/$host/default.nix")
case "$mode" in case "$mode" in
install) install)
prepare_disk "destroy,format,mount" prepare_disk "destroy,format,mount"

View File

@@ -4,7 +4,8 @@
../../lib ../../lib
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
(import ./format.nix { device = "/dev/disk/by-id/nvme-SAMSUNG_MZVL22T0HBLB-00BL2_S64RNE0R602762"; }) ./format.nix
./hardware ./hardware
../common/configs/system/backup ../common/configs/system/backup

View File

@@ -1,11 +1,7 @@
{
device ? throw "device argument is required",
...
}:
{ {
disko.devices = { disko.devices = {
disk.main = { disk.main = {
inherit device; device = "/dev/disk/by-id/nvme-SAMSUNG_MZVL22T0HBLB-00BL2_S64RNE0R602762";
type = "disk"; type = "disk";
content = { content = {
type = "gpt"; type = "gpt";

View File

@@ -4,9 +4,8 @@
../../lib ../../lib
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
(import ./format.nix { ./format.nix
device = "/dev/disk/by-id/ata-Samsung_SSD_990_EVO_1TB_S7GCNL0XA04998F";
})
./hardware ./hardware
../common/configs/system/backup ../common/configs/system/backup

View File

@@ -1,11 +1,7 @@
{
device ? throw "device argument is required",
...
}:
{ {
disko.devices = { disko.devices = {
disk.usb = { disk.usb = {
inherit device; device = "/dev/disk/by-id/ata-Samsung_SSD_990_EVO_1TB_S7GCNL0XA04998F";
type = "disk"; type = "disk";
content = { content = {
type = "gpt"; type = "gpt";

View File

@@ -4,9 +4,8 @@
../../lib ../../lib
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
(import ./format.nix { ./format.nix
device = "/dev/disk/by-id/usb-SanDisk_Ultra_Trek_050133f0afb69de86a475ee8d2ad97e4916cce11764cffba9ab262d42a7d0d2f66460000000000000000000039b7a3b8ff990a109f5581078ea6e86a-0:0";
})
./hardware ./hardware
../common/configs/system/boot ../common/configs/system/boot

View File

@@ -1,11 +1,7 @@
{
device ? throw "device argument is required",
...
}:
{ {
disko.devices = { disko.devices = {
disk.installer = { disk.installer = {
inherit device; device = "/dev/disk/by-id/usb-SanDisk_Ultra_Trek_050133f0afb69de86a475ee8d2ad97e4916cce11764cffba9ab262d42a7d0d2f66460000000000000000000039b7a3b8ff990a109f5581078ea6e86a-0:0";
type = "disk"; type = "disk";
content = { content = {
type = "gpt"; type = "gpt";