update disks for warsaw

This commit is contained in:
albert 2024-07-14 20:10:56 +09:00
parent 7d0e905352
commit 6e74938211
Signed by: albert
GPG key ID: 3895DD267CA11BA9

View file

@ -1,5 +1,4 @@
{ {
# https://github.com/nix-community/disko/blob/master/example/boot-raid1.nix
imports = [ ../../common/services/snapper.nix ]; imports = [ ../../common/services/snapper.nix ];
# extra configs not present in the standard config above # extra configs not present in the standard config above
@ -12,85 +11,26 @@
services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.enable = true;
services.btrfs.autoScrub.interval = "weekly"; services.btrfs.autoScrub.interval = "weekly";
disko.devices = { disko.devices.disk.sda = {
disk = {
sda = {
type = "disk"; type = "disk";
device = "/dev/sda"; device = "/dev/sda";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
BOOT = { BOOT = {
size = "1M"; priority = 1;
type = "EF02"; # GRUB MBR name = "BOOT";
}; start = "0%";
ESP = { end = "550MiB";
size = "500M";
type = "EF00"; type = "EF00";
content = {
type = "mdraid";
name = "boot";
};
};
mdadm = {
size = "100%";
content = {
type = "mdraid";
name = "raid1";
};
};
};
};
};
sdb = {
type = "disk";
device = "/dev/sdb";
content = {
type = "gpt";
partitions = {
BOOT = {
size = "1M";
type = "EF02"; # GRUB MBR
};
ESP = {
size = "500M";
type = "EF00";
content = {
type = "mdraid";
name = "boot";
};
};
mdadm = {
size = "100%";
content = {
type = "mdraid";
name = "raid1";
};
};
};
};
};
};
mdadm = {
boot = {
type = "mdadm";
level = 1;
metadata = "1.0";
content = { content = {
type = "filesystem"; type = "filesystem";
format = "vfat"; format = "vfat";
mountpoint = "/boot"; # https://github.com/nix-community/disko/issues/527
mountOptions = [ "umask=0077" ]; mountOptions = [ "umask=0077" ];
mountpoint = "/boot";
}; };
}; }; # partition 1 (ESP)
raid1 = {
type = "mdadm";
level = 1;
content = {
type = "gpt";
partitions = {
LUKS-ROOT = { LUKS-ROOT = {
start = "550MiB"; start = "550MiB";
end = "100%"; end = "100%";
@ -114,10 +54,6 @@
mountpoint = "/nix"; mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ]; mountOptions = [ "compress=zstd" "noatime" ];
}; # nix }; # nix
"/Storage" = {
mountpoint = "/Storage";
mountOptions = [ "compress=zstd" "noatime" ];
}; # Storage
# SNAPSHOT SUBVOLS # SNAPSHOT SUBVOLS
"/root/.snapshots" = { "/root/.snapshots" = {
mountpoint = "/.snapshots"; mountpoint = "/.snapshots";
@ -131,6 +67,35 @@
mountpoint = "/nix/.snapshots"; mountpoint = "/nix/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ]; mountOptions = [ "compress=zstd" "noatime" ];
}; # nix }; # nix
}; # subvolumes
}; # content.content
}; # content
}; # partition 2 (/ BTRFS)
}; # partitions
}; # content
}; # disko.devices.disk.sda
disko.devices.disk.sdb = {
type = "disk";
device = "/dev/sdb";
content = {
type = "gpt";
partitions = {
LUKS-STORAGE = {
start = "550MiB";
end = "100%";
content = {
type = "luks";
name = "STORAGE";
extraOpenArgs = [ "--allow-discards" ];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/Storage" = {
mountpoint = "/Storage";
mountOptions = [ "compress=zstd" "noatime" ];
}; # Storage
"/Storage/.snapshots" = { "/Storage/.snapshots" = {
mountpoint = "/Storage/.snapshots"; mountpoint = "/Storage/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ]; mountOptions = [ "compress=zstd" "noatime" ];
@ -139,9 +104,7 @@
}; # content.content }; # content.content
}; # content }; # content
}; # partition 2 (/ BTRFS) }; # partition 2 (/ BTRFS)
}; }; # partitions
}; }; # content
}; }; # disko.devices.disk.sdb
}; } # root
};
}