add disko

This commit is contained in:
Zoty 2026-05-23 15:31:28 -03:00
parent 8a35a32445
commit ba6d0a06a0
Signed by: Zoty
SSH key fingerprint: SHA256:WsGEGivgl37t3Mth6uugXMOgMCTR7QolIepNbC+j/tA
7 changed files with 277 additions and 73 deletions

View file

@ -0,0 +1,60 @@
{ 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" ];
};
};
};
};
};
};
};
};
};
}