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"
mkdir -p /mnt
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() {
@@ -109,7 +109,7 @@ finish() {
cleanup() {
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
}
@@ -151,8 +151,6 @@ check_host
check_key
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
install)
prepare_disk "destroy,format,mount"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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