2022-06-24 04:21:01 +00:00
|
|
|
{ ... }:
|
2022-04-27 06:38:39 +00:00
|
|
|
|
|
|
|
{
|
2022-06-29 08:17:53 +00:00
|
|
|
# root is a tmpfs so that we have an ephemeral system ("impermanence" handles the state)
|
2022-06-24 04:21:01 +00:00
|
|
|
fileSystems."/" = {
|
2022-06-29 08:17:53 +00:00
|
|
|
device = "none";
|
|
|
|
fsType = "tmpfs";
|
|
|
|
options = [
|
|
|
|
"mode=755"
|
|
|
|
"size=1G"
|
|
|
|
"defaults"
|
|
|
|
];
|
2022-04-27 06:38:39 +00:00
|
|
|
};
|
2022-06-30 07:17:05 +00:00
|
|
|
# we need a /tmp for building large nix things
|
2022-06-29 08:17:53 +00:00
|
|
|
fileSystems."/tmp" = {
|
|
|
|
device = "none";
|
|
|
|
fsType = "tmpfs";
|
|
|
|
options = [
|
|
|
|
"mode=777"
|
|
|
|
"defaults"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/nix" = {
|
2022-11-29 02:20:18 +00:00
|
|
|
device = "/dev/disk/by-uuid/cc81cca0-3cc7-4d82-a00c-6243af3e7776";
|
2022-06-29 08:17:53 +00:00
|
|
|
fsType = "btrfs";
|
2022-11-29 02:20:18 +00:00
|
|
|
options = [
|
|
|
|
"compress=zstd"
|
|
|
|
"defaults"
|
|
|
|
];
|
2022-06-29 08:17:53 +00:00
|
|
|
};
|
|
|
|
|
2022-05-17 01:58:12 +00:00
|
|
|
fileSystems."/boot" = {
|
2022-11-29 02:20:18 +00:00
|
|
|
device = "/dev/disk/by-uuid/6EE3-4171";
|
2022-05-17 01:58:12 +00:00
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
|
2022-11-29 21:54:33 +00:00
|
|
|
# slow, external storage (for archiving, etc)
|
|
|
|
fileSystems."/nix/persist/ext" = {
|
|
|
|
device = "/dev/disk/by-uuid/aa272cff-0fcc-498e-a4cb-0d95fb60631b";
|
|
|
|
fsType = "btrfs";
|
|
|
|
options = [
|
|
|
|
"compress=zstd"
|
|
|
|
"defaults"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
sane.impermanence.service-dirs = [
|
|
|
|
# TODO: this is overly broad; only need media and share directories to be persisted
|
|
|
|
{ user = "colin"; group = "users"; directory = "/var/lib/uninsane"; }
|
|
|
|
];
|
|
|
|
# direct these media directories to external storage
|
|
|
|
environment.persistence."/nix/persist/ext/persist" = {
|
|
|
|
directories = [
|
|
|
|
({
|
|
|
|
user = "colin";
|
|
|
|
group = "users";
|
|
|
|
mode = "0777";
|
|
|
|
directory = "/var/lib/uninsane/media/Videos";
|
|
|
|
})
|
|
|
|
({
|
|
|
|
user = "colin";
|
|
|
|
group = "users";
|
|
|
|
mode = "0777";
|
|
|
|
directory = "/var/lib/uninsane/media/freeleech";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
1980-01-01 00:53:55 +00:00
|
|
|
# in-memory compressed RAM (seems to be dynamically sized)
|
2022-11-29 02:20:18 +00:00
|
|
|
# zramSwap = {
|
|
|
|
# enable = true;
|
|
|
|
# };
|
1980-01-01 00:53:55 +00:00
|
|
|
|
2022-06-29 10:29:45 +00:00
|
|
|
# btrfs doesn't easily support swapfiles
|
|
|
|
# swapDevices = [
|
|
|
|
# { device = "/nix/persist/swapfile"; size = 4096; }
|
|
|
|
# ];
|
|
|
|
|
|
|
|
# this can be a partition. create with:
|
|
|
|
# fdisk <dev>
|
|
|
|
# n
|
|
|
|
# <default partno>
|
|
|
|
# <start>
|
|
|
|
# <end>
|
|
|
|
# t
|
|
|
|
# <partno>
|
|
|
|
# 19 # set part type to Linux swap
|
|
|
|
# w # write changes
|
|
|
|
# mkswap -L swap <part>
|
2022-11-29 02:20:18 +00:00
|
|
|
# swapDevices = [
|
|
|
|
# {
|
|
|
|
# label = "swap";
|
|
|
|
# # TODO: randomEncryption.enable = true;
|
|
|
|
# }
|
|
|
|
# ];
|
2022-04-27 06:38:39 +00:00
|
|
|
}
|
|
|
|
|