hosts/legion: move to new structure

Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
2025-05-07 17:23:45 +03:00
parent 75990ccc86
commit 7f073e121c
18 changed files with 239 additions and 380 deletions

View File

@ -0,0 +1,16 @@
{inputs, ...}: let
disk-main = "/dev/disk/by-id/nvme-INTEL_SSDPEKKF256G8L_BTHH81460QC2256B";
disk-second = "/dev/disk/by-id/nvme-WDC_PC_SN730_SDBPNTY-1T00-1101_21114D802446";
in {
imports = with inputs; [
disko.nixosModules.disko
];
disko.devices.nodev = {
"/tmp" = {
fsType = "tmpfs";
mountOptions = ["rw" "nosuid" "nodev"];
};
};
disko.devices.disk.main = import ./disk-main.nix {inherit disk-main;};
disko.devices.disk.second = import ./disk-second.nix {inherit disk-second;};
}

View File

@ -0,0 +1,70 @@
{disk-main}: {
type = "disk";
device = disk-main;
content = {
type = "gpt";
partitions = {
ESP = {
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"umask=0077"
"fmask=0022"
"dmask=0022"
"noexec"
"nosuid"
"nodev"
];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "luks-main";
initrdUnlock = true;
settings.allowDiscards = true;
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"@root-nixos" = {
mountpoint = "/";
mountOptions = [
"compress=zstd"
"noatime"
# "noexec"
];
};
"@home" = {
mountpoint = "/home";
mountOptions = [
"compress=zstd"
"noatime"
];
};
"@swap" = {
mountpoint = "/swap";
mountOptions = [
# "compress=zstd"
"noatime"
];
};
# "@nix" = {
# mountpoint = "/nix";
# mountOptions = [
# "compress-force=zstd"
# "noatime"
# ];
# };
};
};
};
};
};
};
}

View File

@ -0,0 +1,31 @@
{disk-second}: {
type = "disk";
device = disk-second;
content = {
type = "gpt";
partitions = {
luks = {
size = "100%";
content = {
type = "luks";
name = "luks-second";
initrdUnlock = true;
settings.allowDiscards = true;
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"@storage" = {
mountpoint = "/storage";
mountOptions = [
"compress=zstd"
"noatime"
];
};
};
};
};
};
};
};
}