System/Nixinator: Configure disko partition layout
This commit is contained in:
@ -29,7 +29,7 @@ with mylib.networking; {
|
|||||||
if headless
|
if headless
|
||||||
then "grub"
|
then "grub"
|
||||||
else "systemd-boot";
|
else "systemd-boot";
|
||||||
systemd-boot.bootDevice = "/boot/efi";
|
systemd-boot.bootDevice = "/boot";
|
||||||
grub.bootDevice = "/dev/sda";
|
grub.bootDevice = "/dev/sda";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./disks.nix
|
||||||
|
|
||||||
../modules
|
../modules
|
||||||
];
|
];
|
||||||
|
102
system/nixinator/disks.nix
Normal file
102
system/nixinator/disks.nix
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
{
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
main = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/disk/by-id/nvme-WD_BLACK_SN850X_2000GB_231623801519";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
label = "EFI";
|
||||||
|
size = "512M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
mountOptions = ["defaults"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
luks = {
|
||||||
|
label = "LUKS";
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "crypted";
|
||||||
|
|
||||||
|
extraOpenArgs = [
|
||||||
|
"--perf-no_read_workqueue"
|
||||||
|
"--perf-no_write_workqueue"
|
||||||
|
];
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
allowDiscards = true;
|
||||||
|
crypttabExtraOpts = ["fido2-device=auto" "token-timeout=10"];
|
||||||
|
|
||||||
|
# Disable for interactive password entry
|
||||||
|
# keyFile = "/tmp/secret.key";
|
||||||
|
};
|
||||||
|
# additionalKeyFiles = ["/tmp/additionalSecret.key"];
|
||||||
|
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
extraArgs = ["-L" "NIXOS" "-f"];
|
||||||
|
subvolumes = {
|
||||||
|
"/root" = {
|
||||||
|
mountpoint = "/";
|
||||||
|
mountOptions = [
|
||||||
|
"subvol=root"
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"/home" = {
|
||||||
|
mountpoint = "/home";
|
||||||
|
mountOptions = [
|
||||||
|
"subvol=home"
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"/nix" = {
|
||||||
|
mountpoint = "/nix";
|
||||||
|
mountOptions = [
|
||||||
|
"subvol=nix"
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"/persist" = {
|
||||||
|
mountpoint = "/persist";
|
||||||
|
mountOptions = [
|
||||||
|
"subvol=persist"
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"/log" = {
|
||||||
|
mountpoint = "/var/log";
|
||||||
|
mountOptions = [
|
||||||
|
"subvol=log"
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"/swap" = {
|
||||||
|
mountpoint = "/swap";
|
||||||
|
swap.swapfile.size = "16G";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/persist".neededForBoot = true;
|
||||||
|
fileSystems."/var/log".neededForBoot = true;
|
||||||
|
}
|
Reference in New Issue
Block a user