mirror of
https://git.sr.ht/~neverness/ultima
synced 2025-01-09 19:03:53 +00:00
80 lines
1.7 KiB
Nix
80 lines
1.7 KiB
Nix
|
{
|
||
|
x,
|
||
|
inputs,
|
||
|
lib,
|
||
|
config,
|
||
|
...
|
||
|
}:
|
||
|
with lib;
|
||
|
with x;
|
||
|
let
|
||
|
cfg = config.module.hardware.disko;
|
||
|
device = "${disk}";
|
||
|
in
|
||
|
{
|
||
|
options = {
|
||
|
module.hardware.disko = {
|
||
|
enable = mkBool;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
imports = with inputs; [
|
||
|
disko.nixosModules.default
|
||
|
];
|
||
|
config = mkIf cfg.enable {
|
||
|
disko.devices.disk.main = {
|
||
|
inherit device;
|
||
|
type = "disk";
|
||
|
content = {
|
||
|
type = "gpt";
|
||
|
partitions = {
|
||
|
esp = {
|
||
|
name = "esp";
|
||
|
size = "512M";
|
||
|
type = "EF00";
|
||
|
content = {
|
||
|
type = "filesystem";
|
||
|
format = "vfat";
|
||
|
mountpoint = "/boot";
|
||
|
mountOptions = [
|
||
|
"umask=0077"
|
||
|
"fmask=0077"
|
||
|
"dmask=0077"
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
root = {
|
||
|
name = "nixos";
|
||
|
size = "100%";
|
||
|
content = {
|
||
|
type = "btrfs";
|
||
|
extraArgs = [ "-f" ];
|
||
|
subvolumes = {
|
||
|
"/rootfs".mountpoint = "/";
|
||
|
"/home" = {
|
||
|
mountpoint = "/home";
|
||
|
mountOptions = [ "compress=zstd:5" ];
|
||
|
};
|
||
|
"/nix" = {
|
||
|
mountpoint = "/nix";
|
||
|
mountOptions = [
|
||
|
"compress=zstd:5"
|
||
|
"noatime"
|
||
|
];
|
||
|
};
|
||
|
"/persist" = {
|
||
|
mountpoint = "/persist";
|
||
|
mountOptions = [
|
||
|
"compress=zstd:5"
|
||
|
"noatime"
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|