flakes/hosts/caramel/filesystem.nix

51 lines
1.2 KiB
Nix
Raw Normal View History

{ config, lib, ... }:
2022-02-02 00:50:39 +07:00
let
bind = src: {
depends = [ "/persist" ];
2022-02-02 00:50:39 +07:00
device = src;
fsType = "none";
neededForBoot = true;
options = [ "bind" ];
};
in {
fileSystems = {
"/" = lib.mkForce {
2022-02-02 00:50:39 +07:00
device = "rootfs";
fsType = "tmpfs";
options = [ "defaults" "size=1G" "mode=755" ];
2022-02-02 00:50:39 +07:00
};
# "/nix" = {
# device = "overlayfs";
# fsType = "overlay";
# options = [
# "lowerdir=/mnt/image/nix"
# "upperdir=/persist/nix-overlay"
# "workdir=/persist/.overlaytmp"
# ];
# noCheck = true;
# depends = [ "/mnt/image" "/persist" ];
# };
"/nix" = (bind "/mnt/image/nix") // { depends = [ "/mnt/image" ]; };
"/mnt/image" = {
2022-02-02 00:50:39 +07:00
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "defaults" "noatime" ];
neededForBoot = true;
2022-02-02 00:50:39 +07:00
};
"/persist" = {
device = "/dev/disk/by-label/PI_HDD";
fsType = "ext4";
options = [ "defaults" "relatime" ];
neededForBoot = true;
};
2022-02-14 18:45:29 +07:00
"/var/lib/acme" = bind "/persist/acme";
"/var/log/journal" = bind "/persist/journal";
"/boot" = (bind "/mnt/image/boot") // { depends = [ "/mnt/image" ]; };
2022-02-02 00:50:39 +07:00
};
}