60 lines
1.8 KiB
Nix
60 lines
1.8 KiB
Nix
{ lib, config, ... }: {
|
|
options.local.notebook.disk = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "/dev/nvme0n1";
|
|
description = "Target block device for the notebook. Change this if the machine does not have an NVMe drive (e.g. /dev/sda).";
|
|
};
|
|
|
|
config.disko.devices = {
|
|
disk.main = {
|
|
device = config.local.notebook.disk;
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ESP = {
|
|
size = "512M";
|
|
type = "EF00";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
mountOptions = [ "fmask=0077" "dmask=0077" ];
|
|
};
|
|
};
|
|
|
|
luks = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "cryptroot";
|
|
settings.allowDiscards = true;
|
|
content = {
|
|
type = "btrfs";
|
|
extraArgs = [ "-f" ];
|
|
subvolumes = {
|
|
"@root" = {
|
|
mountpoint = "/";
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
};
|
|
"@nix" = {
|
|
mountpoint = "/nix";
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
};
|
|
"@home" = {
|
|
mountpoint = "/home";
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
};
|
|
"@log" = {
|
|
mountpoint = "/var/log";
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|