dots/hosts/bocchi/disko.nix

78 lines
2.6 KiB
Nix

{ ... }:
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ]; # Override existing partition
# Subvolumes must set a mountpoint in order to be mounted,
# unless their parent is mounted
subvolumes = {
# Subvolume name is different from mountpoint
"/root" = {
mountpoint = "/";
};
# Subvolume name is the same as the mountpoint
"/home" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/home";
};
"/nix" = {
mountOptions = [
"compress=zstd"
"noatime"
];
mountpoint = "/nix";
};
"/media" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/media";
};
"/media/shows" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/shows"; };
"/media/movies" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/movies"; };
"/media/music" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/music"; };
"/media/books" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/books"; };
"/media/repositories" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/repositories"; };
"/media/torrents" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/torrents"; };
# Subvolume for the swapfile
"/swap" = {
mountpoint = "/.swapvol";
swap = {
swapfile.size = "20M";
swapfile2.size = "20M";
swapfile2.path = "rel-path";
};
};
};
};
};
};
};
};
};
};
}