nixos/modules/filesystem/chn-PC.nix

64 lines
1.3 KiB
Nix
Raw Normal View History

2023-06-05 21:53:13 +08:00
{
config =
{
fileSystems =
{
"/" =
2023-06-16 15:50:02 +08:00
{
device = "tmpfs";
fsType = "tmpfs";
options = [ "relatime" "mode=755" ];
};
"/nix" =
{
device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "subvol=@nix" "compress-force=zstd:3" ];
};
"/impermanence" =
2023-06-05 21:53:13 +08:00
{
device = "/dev/mapper/root";
fsType = "btrfs";
2023-06-16 15:50:02 +08:00
options = [ "subvol=@impermanence" "compress-force=zstd:3" ];
neededForBoot = true;
2023-06-05 21:53:13 +08:00
};
2023-06-09 21:09:52 +08:00
"/swap" = {
device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "subvol=@swap" ];
};
2023-06-05 21:53:13 +08:00
"/boot" =
{
device = "/dev/disk/by-uuid/50DE-B72A";
fsType = "vfat";
};
};
2023-06-09 21:09:52 +08:00
swapDevices = [ { device = "/swap/swap"; } ];
2023-06-05 21:53:13 +08:00
boot.initrd.luks.devices.root =
{
device = "/dev/disk/by-partuuid/49fe75e3-bd94-4c75-9b21-2c77a1f74c4e";
header = "/dev/disk/by-partuuid/c341ca23-bb14-4927-9b31-a9dcc959d0f5";
allowDiscards = true;
};
2023-06-16 15:50:02 +08:00
environment.persistence."/impermanence" =
{
hideMounts = true;
directories =
[
"/etc/NetworkManager/system-connections"
"/home"
"/root"
"/var"
];
files =
[
"/etc/machine-id"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_rsa_key.pub"
"/etc/ssh/ssh_host_rsa_key"
];
};
2023-06-05 21:53:13 +08:00
};
}