curacao: New razmo!

This commit is contained in:
Geoffrey Frogeye 2024-05-12 20:34:22 +02:00
parent 88e0a1eb09
commit 2804086233
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8

View file

@ -3,29 +3,39 @@
# TODO Not relatime everywhere, thank you # TODO Not relatime everywhere, thank you
# TODO Default options # TODO Default options
let let
btrfs_args_hdd = [ btrfs_args_ssd = [
"rw" "rw"
"relatime" "relatime"
"compress=zstd:3" "compress=zstd:3"
"space_cache" "space_cache"
"ssd"
]; ];
btrfs_args_ssd = btrfs_args_hdd ++ [ "ssd" ];
passwordFile = "/tmp/dotfiles_${config.networking.hostName}_password"; passwordFile = "/tmp/dotfiles_${config.networking.hostName}_password";
in in
{ {
boot.loader.efi.efiSysMountPoint = config.disko.devices.disk.razmo.content.partitions.esp.content.mountpoint;
disko.devices = { disko.devices = {
disk = { disk = {
razmo = { razmo = {
type = "disk"; type = "disk";
device = "/dev/disk/by-id/ata-ST1000LM048-2E7172_WKP8925H"; device = "/dev/disk/by-id/ata-SDLF1DAR-960G-1HA1_A027C1A3";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
ESP = {
# Needs enough to store multiple kernel generations
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
swap = { swap = {
priority = 10; size = "8G";
start = "2048";
size = "6G";
content = { content = {
type = "swap"; type = "swap";
randomEncryption = true; randomEncryption = true;
@ -36,78 +46,27 @@ in
# Untranslated options from /etc/crypttab: swap,cipher=aes-xts-plain64,size=256 # Untranslated options from /etc/crypttab: swap,cipher=aes-xts-plain64,size=256
}; };
}; };
nixosboot = { luks = {
priority = 15; size = "100%";
size = "2G";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
esp = {
priority = 20;
size = "128M";
type = "EF00"; # EFI system partition
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/efi";
mountOptions = [
"rw"
"relatime"
"fmask=0022"
"dmask=0022"
"codepage=437"
"iocharset=iso8859-1"
"shortname=mixed"
"utf8"
"errors=remount-ro"
"noauto"
];
};
};
boot = {
priority = 30;
size = "128M";
content = {
type = "luks";
name = "boot";
extraFormatArgs = [ "--type luks1" ];
passwordFile = passwordFile;
settings = {
# keyFile = "/etc/keys/boot";
};
content = {
type = "filesystem";
format = "ext2";
mountpoint = "/mnt/old/boot";
mountOptions = [
"rw"
"relatime"
# "stripe=4" # For some reason doesn't work on NixOS
];
};
};
};
main = {
priority = 40;
content = { content = {
type = "luks"; type = "luks";
name = "razmo"; name = "razmo";
passwordFile = passwordFile; passwordFile = passwordFile;
settings = { settings = {
# keyFile = "/etc/keys/razmo"; allowDiscards = true;
}; };
content = { content = {
type = "btrfs"; type = "btrfs";
# extraArgs = [ "-f" ]; extraArgs = [ "-f" ];
mountpoint = "/mnt/razmo"; mountpoint = "/mnt/razmo";
mountOptions = btrfs_args_hdd;
subvolumes = { subvolumes = {
"home.razmo" = { "home.razmo" = {
mountpoint = "/home.heavy"; mountpoint = "/home.heavy";
mountOptions = btrfs_args_hdd; mountOptions = [ "compress=zstd" "relatime" ];
};
"steam" = {
mountpoint = "/opt/steam.razmo";
mountOptions = [ "compress=zstd" "noatime" ];
}; };
}; };
}; };