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,136 +11,100 @@
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 = { type = "disk";
sda = { device = "/dev/sda";
type = "disk"; content = {
device = "/dev/sda"; type = "gpt";
content = { partitions = {
type = "gpt"; BOOT = {
partitions = { priority = 1;
BOOT = { name = "BOOT";
size = "1M"; start = "0%";
type = "EF02"; # GRUB MBR end = "550MiB";
}; type = "EF00";
ESP = { content = {
size = "500M"; type = "filesystem";
type = "EF00"; format = "vfat";
content = { # https://github.com/nix-community/disko/issues/527
type = "mdraid"; mountOptions = [ "umask=0077" ];
name = "boot"; mountpoint = "/boot";
};
};
mdadm = {
size = "100%";
content = {
type = "mdraid";
name = "raid1";
};
};
}; };
}; }; # partition 1 (ESP)
}; LUKS-ROOT = {
start = "550MiB";
end = "100%";
content = {
type = "luks";
name = "ROOT";
extraOpenArgs = [ "--allow-discards" ];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
}; # root
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
}; # home
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
}; # nix
# SNAPSHOT SUBVOLS
"/root/.snapshots" = {
mountpoint = "/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
}; # root
"/home/.snapshots" = {
mountpoint = "/home/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
}; # home
"/nix/.snapshots" = {
mountpoint = "/nix/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
}; # nix
}; # subvolumes
}; # content.content
}; # content
}; # partition 2 (/ BTRFS)
}; # partitions
}; # content
}; # disko.devices.disk.sda
sdb = { disko.devices.disk.sdb = {
type = "disk"; type = "disk";
device = "/dev/sdb"; device = "/dev/sdb";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
BOOT = { LUKS-STORAGE = {
size = "1M"; start = "550MiB";
type = "EF02"; # GRUB MBR end = "100%";
}; content = {
ESP = { type = "luks";
size = "500M"; name = "STORAGE";
type = "EF00"; extraOpenArgs = [ "--allow-discards" ];
content = { content = {
type = "mdraid"; type = "btrfs";
name = "boot"; extraArgs = [ "-f" ];
}; subvolumes = {
}; "/Storage" = {
mdadm = { mountpoint = "/Storage";
size = "100%"; mountOptions = [ "compress=zstd" "noatime" ];
content = { }; # Storage
type = "mdraid"; "/Storage/.snapshots" = {
name = "raid1"; mountpoint = "/Storage/.snapshots";
}; mountOptions = [ "compress=zstd" "noatime" ];
}; }; # Storage
}; }; # subvolumes
}; }; # content.content
}; }; # content
}; }; # partition 2 (/ BTRFS)
}; # partitions
mdadm = { }; # content
boot = { }; # disko.devices.disk.sdb
type = "mdadm"; } # root
level = 1;
metadata = "1.0";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
raid1 = {
type = "mdadm";
level = 1;
content = {
type = "gpt";
partitions = {
LUKS-ROOT = {
start = "550MiB";
end = "100%";
content = {
type = "luks";
name = "ROOT";
extraOpenArgs = [ "--allow-discards" ];
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
}; # root
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
}; # home
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
}; # nix
"/Storage" = {
mountpoint = "/Storage";
mountOptions = [ "compress=zstd" "noatime" ];
}; # Storage
# SNAPSHOT SUBVOLS
"/root/.snapshots" = {
mountpoint = "/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
}; # root
"/home/.snapshots" = {
mountpoint = "/home/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
}; # home
"/nix/.snapshots" = {
mountpoint = "/nix/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
}; # nix
"/Storage/.snapshots" = {
mountpoint = "/Storage/.snapshots";
mountOptions = [ "compress=zstd" "noatime" ];
}; # Storage
}; # subvolumes
}; # content.content
}; # content
}; # partition 2 (/ BTRFS)
};
};
};
};
};
}