update disks for warsaw

This commit is contained in:
albert 2024-07-14 20:25:12 +09:00
parent 6e74938211
commit 8466d89765
Signed by: albert
GPG key ID: 3895DD267CA11BA9

View file

@ -1,110 +1,101 @@
{ {
imports = [ ../../common/services/snapper.nix ]; # https://github.com/nix-community/disko/blob/master/example/boot-raid1.nix
disko.devices = {
# extra configs not present in the standard config above disk = {
services.snapper.configs.Storage = { sda = {
TIMELINE_CREATE = true; type = "disk";
TIMELINE_CLEANUP = true; device = "/dev/sda";
SUBVOLUME = "/Storage"; content = {
}; type = "gpt";
partitions = {
services.btrfs.autoScrub.enable = true; BOOT = {
services.btrfs.autoScrub.interval = "weekly"; size = "1M";
type = "EF02"; # GRUB MBR
disko.devices.disk.sda = { };
type = "disk"; ESP = {
device = "/dev/sda"; size = "500M";
content = { type = "EF00";
type = "gpt"; content = {
partitions = { type = "mdraid";
BOOT = { name = "boot";
priority = 1; };
name = "BOOT"; };
start = "0%"; mdadm = {
end = "550MiB"; size = "100%";
type = "EF00"; content = {
content = { type = "mdraid";
type = "filesystem"; name = "raid1";
format = "vfat"; };
# https://github.com/nix-community/disko/issues/527 };
mountOptions = [ "umask=0077" ];
mountpoint = "/boot";
}; };
}; # 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
disko.devices.disk.sdb = { sdb = {
type = "disk"; type = "disk";
device = "/dev/sdb"; device = "/dev/sdb";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
LUKS-STORAGE = { BOOT = {
start = "550MiB"; size = "1M";
end = "100%"; type = "EF02"; # GRUB MBR
content = { };
type = "luks"; ESP = {
name = "STORAGE"; size = "500M";
extraOpenArgs = [ "--allow-discards" ]; type = "EF00";
content = { content = {
type = "btrfs"; type = "mdraid";
extraArgs = [ "-f" ]; name = "boot";
subvolumes = { };
"/Storage" = { };
mountpoint = "/Storage"; mdadm = {
mountOptions = [ "compress=zstd" "noatime" ]; size = "100%";
}; # Storage content = {
"/Storage/.snapshots" = { type = "mdraid";
mountpoint = "/Storage/.snapshots"; name = "raid1";
mountOptions = [ "compress=zstd" "noatime" ]; };
}; # Storage };
}; # subvolumes };
}; # content.content };
}; # content };
}; # partition 2 (/ BTRFS) };
}; # partitions
}; # content mdadm = {
}; # disko.devices.disk.sdb boot = {
} # root type = "mdadm";
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 = "filesystem";
format = "ext4";
mountpoint = "/";
}; # content.content
}; # content
}; # partition 2 (/ BTRFS)
};
};
};
};
};
}