Files
Olympus/system/disko/disko.nix
2024-10-19 08:44:02 -05:00

80 lines
2.8 KiB
Nix

{ config, lib, ... }: {
options.sysconfig.opts.devices.main = lib.options.mkOption {
type = lib.types.str;
default = null;
};
config = lib.mkIf config.disko.enable {
disko.devices = {
disk.main = {
device = config.sysconfig.opts.devices.main;
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
swap = {
size = "4G";
content = {
type = "swap";
resumeDevice = true;
};
};
root = {
name = "root";
size = "100%";
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
lvm_vg = {
root_vg = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
};
"/persist" = {
mountOptions = [ "subvol=persist" "noatime" ];
mountpoint = "/persist";
};
"/nix" = {
mountOptions = [ "subvol=nix" "noatime" ];
mountpoint = "/nix";
};
};
};
};
};
};
};
};
};
}