treewide: dedup disko configuration
This commit is contained in:
parent
71ed8b5ebb
commit
fd97c33c56
|
@ -1,76 +1,4 @@
|
|||
{
|
||||
disko.devices = {
|
||||
nodev = {
|
||||
"/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"size=8G"
|
||||
"mode=755"
|
||||
"nosuid"
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-path/pci-0000:04:00.0-nvme-1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
esp = {
|
||||
label = "ESP";
|
||||
size = "2G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
cryptroot = {
|
||||
label = "CRYPTROOT";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "cryptroot";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
bypassWorkqueues = true;
|
||||
crypttabExtraOpts = [
|
||||
"same-cpu-crypt"
|
||||
"submit-from-crypt-cpus"
|
||||
];
|
||||
# unattended boot via usb
|
||||
keyFile = "/dev/disk/by-id/usb-aigo_U330_80101016-0:0";
|
||||
keyFileSize = 512 * 64;
|
||||
};
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"/persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
environment.globalPersistence = {
|
||||
enable = true;
|
||||
root = "/persist";
|
||||
|
|
|
@ -1,13 +1,29 @@
|
|||
{ ... }:
|
||||
{ profiles, ... }:
|
||||
{
|
||||
imports = with profiles; [
|
||||
system.disko.luks-btrfs-common
|
||||
];
|
||||
|
||||
disko.devices = {
|
||||
nodev."/".mountOptions = [ "size=16G" ];
|
||||
disk.main.device = "/dev/disk/by-path/pci-0000:04:00.0-nvme-1";
|
||||
};
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = [
|
||||
initrd = {
|
||||
availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
# workaround for https://github.com/nix-community/disko/issues/678
|
||||
luks.devices.cryptroot = {
|
||||
keyFile = "/dev/disk/by-id/usb-aigo_U330_80101016-0:0";
|
||||
keyFileSize = 512 * 64;
|
||||
};
|
||||
};
|
||||
kernelModules = [ "kvm-amd" ];
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = false;
|
||||
|
|
|
@ -1,60 +1,4 @@
|
|||
{
|
||||
disko.devices = {
|
||||
nodev = {
|
||||
"/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"size=2G"
|
||||
"mode=755"
|
||||
"nosuid"
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/vda";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
type = "EF02";
|
||||
label = "BOOT";
|
||||
start = "0";
|
||||
end = "+1M";
|
||||
};
|
||||
root = {
|
||||
label = "ROOT";
|
||||
end = "-0";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"boot" = {
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
environment.globalPersistence = {
|
||||
enable = true;
|
||||
root = "/persist";
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
{ modulesPath, ... }:
|
||||
{ modulesPath, profiles, ... }:
|
||||
{
|
||||
imports = [
|
||||
imports = with profiles; [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
system.disko.btrfs-bios-compat
|
||||
];
|
||||
|
||||
disko.devices = {
|
||||
nodev."/".mountOptions = [ "size=2G" ];
|
||||
disk.main.device = "/dev/vda";
|
||||
};
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ahci"
|
||||
"xhci_pci"
|
||||
|
|
|
@ -1,73 +1,4 @@
|
|||
{
|
||||
disko.devices = {
|
||||
nodev = {
|
||||
"/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"size=8G"
|
||||
"mode=755"
|
||||
"nosuid"
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-path/pci-0000:04:00.0-nvme-1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
esp = {
|
||||
label = "ESP";
|
||||
size = "2G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
cryptroot = {
|
||||
label = "CRYPTROOT";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "cryptroot";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
bypassWorkqueues = true;
|
||||
crypttabExtraOpts = [
|
||||
"same-cpu-crypt"
|
||||
"submit-from-crypt-cpus"
|
||||
];
|
||||
};
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"/persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
environment.globalPersistence = {
|
||||
enable = true;
|
||||
root = "/persist";
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
{ lib, ... }:
|
||||
{ profiles, lib, ... }:
|
||||
{
|
||||
imports = with profiles; [
|
||||
system.disko.luks-btrfs-common
|
||||
];
|
||||
|
||||
disko.devices = {
|
||||
nodev."/".mountOptions = [ "size=8G" ];
|
||||
disk.main.device = "/dev/disk/by-path/pci-0000:04:00.0-nvme-1";
|
||||
};
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
|
|
|
@ -1,73 +1,4 @@
|
|||
{
|
||||
disko.devices = {
|
||||
nodev = {
|
||||
"/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"size=8G"
|
||||
"mode=755"
|
||||
"nosuid"
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-path/pci-0000:04:00.0-nvme-1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
esp = {
|
||||
label = "ESP";
|
||||
size = "2G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
cryptroot = {
|
||||
label = "CRYPTROOT";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "cryptroot";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
bypassWorkqueues = true;
|
||||
crypttabExtraOpts = [
|
||||
"same-cpu-crypt"
|
||||
"submit-from-crypt-cpus"
|
||||
];
|
||||
};
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"/persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
environment.globalPersistence = {
|
||||
enable = true;
|
||||
root = "/persist";
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
{ lib, ... }:
|
||||
{ profiles, lib, ... }:
|
||||
{
|
||||
imports = with profiles; [
|
||||
system.disko.luks-btrfs-common
|
||||
];
|
||||
|
||||
disko.devices = {
|
||||
nodev."/".mountOptions = [ "size=8G" ];
|
||||
disk.main.device = "/dev/disk/by-path/pci-0000:04:00.0-nvme-1";
|
||||
};
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
|
|
|
@ -1,61 +1,4 @@
|
|||
{
|
||||
disko.devices = {
|
||||
nodev = {
|
||||
"/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"size=1G"
|
||||
"mode=755"
|
||||
"nosuid"
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/vda";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
esp = {
|
||||
label = "ESP";
|
||||
size = "2G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
root = {
|
||||
label = "ROOT";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"/persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
environment.globalPersistence = {
|
||||
enable = true;
|
||||
root = "/persist";
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
{ modulesPath, ... }:
|
||||
{ modulesPath, profiles, ... }:
|
||||
{
|
||||
imports = [
|
||||
imports = with profiles; [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
system.disko.btrfs-common
|
||||
];
|
||||
|
||||
disko.devices = {
|
||||
nodev."/".mountOptions = [ "size=1G" ];
|
||||
disk.main.device = "/dev/vda";
|
||||
};
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
|
|
|
@ -1,61 +1,4 @@
|
|||
{
|
||||
disko.devices = {
|
||||
nodev = {
|
||||
"/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"size=1G"
|
||||
"mode=755"
|
||||
"nosuid"
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/vda";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
esp = {
|
||||
label = "ESP";
|
||||
size = "2G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
root = {
|
||||
label = "ROOT";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"/persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
environment.globalPersistence = {
|
||||
enable = true;
|
||||
root = "/persist";
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
{ modulesPath, ... }:
|
||||
{ modulesPath, profiles, ... }:
|
||||
{
|
||||
imports = [
|
||||
imports = with profiles; [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
system.disko.btrfs-common
|
||||
];
|
||||
|
||||
disko.devices = {
|
||||
nodev."/".mountOptions = [ "size=1G" ];
|
||||
disk.main.device = "/dev/vda";
|
||||
};
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
|
|
|
@ -1,61 +1,4 @@
|
|||
{
|
||||
disko.devices = {
|
||||
nodev = {
|
||||
"/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"size=1G"
|
||||
"mode=755"
|
||||
"nosuid"
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/vda";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
esp = {
|
||||
label = "ESP";
|
||||
size = "2G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
root = {
|
||||
label = "ROOT";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"/persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
environment.globalPersistence = {
|
||||
enable = true;
|
||||
root = "/persist";
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
{ modulesPath, ... }:
|
||||
{ modulesPath, profiles, ... }:
|
||||
{
|
||||
imports = [
|
||||
imports = with profiles; [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
system.disko.btrfs-common
|
||||
];
|
||||
|
||||
disko.devices = {
|
||||
nodev."/".mountOptions = [ "size=1G" ];
|
||||
disk.main.device = "/dev/vda";
|
||||
};
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
|
|
|
@ -1,61 +1,4 @@
|
|||
{
|
||||
disko.devices = {
|
||||
nodev = {
|
||||
"/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"size=1G"
|
||||
"mode=755"
|
||||
"nosuid"
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/vda";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
esp = {
|
||||
label = "ESP";
|
||||
size = "2G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
root = {
|
||||
label = "ROOT";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"/persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
environment.globalPersistence = {
|
||||
enable = true;
|
||||
root = "/persist";
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
{ modulesPath, ... }:
|
||||
{ modulesPath, profiles, ... }:
|
||||
{
|
||||
imports = [
|
||||
imports = with profiles; [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
system.disko.btrfs-common
|
||||
];
|
||||
|
||||
disko.devices = {
|
||||
nodev."/".mountOptions = [ "size=1G" ];
|
||||
disk.main.device = "/dev/vda";
|
||||
};
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
|
|
|
@ -1,60 +1,4 @@
|
|||
{
|
||||
disko.devices = {
|
||||
nodev = {
|
||||
"/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"size=4G"
|
||||
"mode=755"
|
||||
"nosuid"
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/sda";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
type = "EF02";
|
||||
label = "BOOT";
|
||||
start = "0";
|
||||
end = "+1M";
|
||||
};
|
||||
root = {
|
||||
label = "ROOT";
|
||||
end = "-0";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"boot" = {
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
environment.globalPersistence = {
|
||||
enable = true;
|
||||
root = "/persist";
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
{ modulesPath, ... }:
|
||||
{ modulesPath, profiles, ... }:
|
||||
{
|
||||
imports = [
|
||||
imports = with profiles; [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
system.disko.btrfs-bios-compat
|
||||
];
|
||||
|
||||
disko.devices = {
|
||||
nodev."/".mountOptions = [ "size=4G" ];
|
||||
disk.main.device = "/dev/sda";
|
||||
};
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ata_piix"
|
||||
"uhci_hcd"
|
||||
|
|
56
nixos/profiles/system/disko/btrfs-bios-compat.nix
Normal file
56
nixos/profiles/system/disko/btrfs-bios-compat.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{ ... }:
|
||||
{
|
||||
disko.devices = {
|
||||
nodev = {
|
||||
"/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"mode=755"
|
||||
"nosuid"
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
type = "EF02";
|
||||
label = "BOOT";
|
||||
start = "0";
|
||||
end = "+1M";
|
||||
};
|
||||
root = {
|
||||
label = "ROOT";
|
||||
end = "-0";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"/boot" = {
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"/persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
}
|
57
nixos/profiles/system/disko/btrfs-common.nix
Normal file
57
nixos/profiles/system/disko/btrfs-common.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{ ... }:
|
||||
{
|
||||
disko.devices = {
|
||||
nodev = {
|
||||
"/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"mode=755"
|
||||
"nosuid"
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
esp = {
|
||||
label = "ESP";
|
||||
size = "2G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
root = {
|
||||
label = "ROOT";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"/persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
}
|
69
nixos/profiles/system/disko/luks-btrfs-common.nix
Normal file
69
nixos/profiles/system/disko/luks-btrfs-common.nix
Normal file
|
@ -0,0 +1,69 @@
|
|||
{ ... }:
|
||||
{
|
||||
disko.devices = {
|
||||
nodev = {
|
||||
"/" = {
|
||||
fsType = "tmpfs";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
"mode=755"
|
||||
"nosuid"
|
||||
"nodev"
|
||||
];
|
||||
};
|
||||
};
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
esp = {
|
||||
label = "ESP";
|
||||
size = "2G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
cryptroot = {
|
||||
label = "CRYPTROOT";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "cryptroot";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
bypassWorkqueues = true;
|
||||
crypttabExtraOpts = [
|
||||
"same-cpu-crypt"
|
||||
"submit-from-crypt-cpus"
|
||||
];
|
||||
};
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
"/persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
}
|
Loading…
Reference in a new issue