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