nix-config/nixos/hosts/capibara/file-systems.nix

136 lines
3.2 KiB
Nix
Raw Normal View History

2023-08-12 17:33:27 +02:00
{ config, pkgs, stablePkgs, ... }:
{
boot = {
loader = {
grub = {
efiSupport = false;
efiInstallAsRemovable = false;
enable = true;
device = "/dev/disk/by-id/ata-KINGSTON_SKC600MS512G_50026B7783FC3D2F";
};
};
initrd = {
luks = {
devices = {
root = {
device = "/dev/disk/by-uuid/869b4b9e-5004-4625-877f-6b1c9489ac8f";
allowDiscards = true;
};
data = {
device = "/dev/disk/by-uuid/6a9246a0-984b-471c-9950-be16db3060f5";
allowDiscards = true;
};
};
reusePassphrases = true;
};
};
};
fileSystems = {
"/" = {
device = "tmpfs";
fsType = "tmpfs";
options = [ "defaults" "size=2G" "mode=755" ];
};
"/mnt/btr_root" = {
device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "subvolid=5" "compress=zstd" ];
};
"/mnt/btr_data" = {
device = "/dev/mapper/data";
fsType = "btrfs";
options = [ "subvolid=5" "compress=zstd" ];
};
"/mnt/persist" = {
device = "/dev/mapper/data";
fsType = "btrfs";
options = [ "subvol=persist" "compress=zstd" ];
neededForBoot = true;
};
"/mnt/logs" = {
device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "subvol=logs" "compress=zstd" ];
neededForBoot = true;
};
"/mnt/data" = {
device = "/dev/mapper/data";
fsType = "btrfs";
options = [ "subvol=data" "compress=zstd" ];
neededForBoot = true;
};
"/mnt/secrets" = {
device = "narwhal:/secrets";
fsType = "nfs";
options = [ "noauto" ];
};
"/mnt/secrets/gnupg" = {
device = "/dev/mapper/gnupg_secrets";
fsType = "btrfs";
options = [ "noauto" ];
};
"/nix" = {
device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" ];
};
"/boot" = {
device = "/dev/disk/by-uuid/c99d1f1b-45a4-4a25-b5b8-bc76464c6825";
fsType = "ext4";
};
"/swap" = {
device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "subvol=swap" ];
};
"/mnt/vfs_share" = {
device = "/dev/mapper/data";
fsType = "btrfs";
options = [ "subvol=vfs_share" "compress=zstd" ];
neededForBoot = true;
};
"/mnt/backups/0" = {
device = "/dev/mapper/backups0";
fsType = "btrfs";
options = [ "noauto" "subvolid=5" "compress=zstd" ];
};
"/mnt/backups/1" = {
device = "/dev/mapper/backups1";
fsType = "btrfs";
options = [ "noauto" "subvolid=5" "compress=zstd" ];
};
"/mnt/backups/2" = {
device = "/dev/mapper/backups2";
fsType = "btrfs";
options = [ "noauto" "subvolid=5" "compress=zstd" ];
};
};
swapDevices = [{ device = "/swap/swapfile"; }];
environment.etc.crypttab.text = ''
backups0 UUID="e45232d5-f46f-46f3-a150-be26374b3357" /etc/luks-keys/backups.bin noauto
backups1 UUID="5b3da928-4862-4451-89cd-5bd6a95466d0" /etc/luks-keys/backups.bin noauto
backups2 UUID="cbfa9cba-dee2-4d0b-8cde-2f1d1849b22c" /etc/luks-keys/backups.bin noauto
gnupg_secrets /mnt/secrets/gnupg.img none noauto
'';
}