From 3ba8494da1faa76befef573decf96eac6d7159b1 Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Fri, 21 Apr 2023 10:09:31 -0400 Subject: [PATCH] disko changes --- flake.nix | 4 - systems/game-laptop/default.nix | 4 +- systems/game-laptop/disko.nix | 67 +++--- systems/gerg-desktop/default.nix | 3 +- systems/gerg-desktop/disko.nix | 359 ++++++++++++++++--------------- systems/moms-laptop/default.nix | 3 +- systems/moms-laptop/disko.nix | 71 +++--- 7 files changed, 256 insertions(+), 255 deletions(-) diff --git a/flake.nix b/flake.nix index e0f311f..bd94264 100644 --- a/flake.nix +++ b/flake.nix @@ -45,7 +45,6 @@ flake-utils, nvim-flake, nixos-generators, - disko, ... }: { @@ -59,7 +58,6 @@ }; }; modules = [ - disko.nixosModules.disko (import ./modules inputs) (import ./systems/gerg-desktop inputs) { @@ -78,7 +76,6 @@ }; }; modules = [ - disko.nixosModules.disko (import ./modules inputs) (import ./systems/game-laptop inputs) ]; @@ -92,7 +89,6 @@ }; }; modules = [ - disko.nixosModules.disko (import ./modules inputs) (import ./systems/moms-laptop inputs) ]; diff --git a/systems/game-laptop/default.nix b/systems/game-laptop/default.nix index 9744c43..e759acb 100644 --- a/systems/game-laptop/default.nix +++ b/systems/game-laptop/default.nix @@ -1,16 +1,14 @@ inputs: { pkgs, - lib, settings, config, ... }: { imports = [ (import ./prime.nix inputs) + (import ./disko.nix inputs) ]; - disko.devices = import ./disko.nix; - localModules = { DE.gnome.enable = true; DM = { diff --git a/systems/game-laptop/disko.nix b/systems/game-laptop/disko.nix index 9a0129d..0874fd8 100644 --- a/systems/game-laptop/disko.nix +++ b/systems/game-laptop/disko.nix @@ -1,35 +1,38 @@ -_: { - disk.nvme0n1 = { - device = "/dev/disk/by-id/nvme-WDC_PC_SN530_SDBPNPZ-512G-1006_21311N802456"; - type = "disk"; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "ESP"; - start = "1MiB"; - end = "1GiB"; - bootable = true; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - } - { - name = "root"; - start = "1GiB"; - end = "100%"; - part-type = "primary"; - bootable = true; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - } - ]; +{disko, ...}: { + imports = [disko.nixosModules.disko]; + disko.devices = { + disk.nvme0n1 = { + device = "/dev/disk/by-id/nvme-WDC_PC_SN530_SDBPNPZ-512G-1006_21311N802456"; + type = "disk"; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + name = "ESP"; + start = "1MiB"; + end = "1GiB"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + } + { + name = "root"; + start = "1GiB"; + end = "100%"; + part-type = "primary"; + bootable = true; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + } + ]; + }; }; }; } diff --git a/systems/gerg-desktop/default.nix b/systems/gerg-desktop/default.nix index a0ca5a4..1740e4a 100644 --- a/systems/gerg-desktop/default.nix +++ b/systems/gerg-desktop/default.nix @@ -11,10 +11,9 @@ inputs: { (import ./zfs.nix inputs) (import ./containers inputs) (import ./erase-your-darlings.nix inputs) + (import ./disko.nix inputs) ]; - disko.devices = import ./disko.nix; - localModules = { X11Programs = { sxhkd.enable = true; diff --git a/systems/gerg-desktop/disko.nix b/systems/gerg-desktop/disko.nix index 0347f31..cbd375a 100644 --- a/systems/gerg-desktop/disko.nix +++ b/systems/gerg-desktop/disko.nix @@ -1,187 +1,190 @@ -_: { - disk = { - nvme0 = { - type = "disk"; - device = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N22"; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "boot"; - start = "0"; - end = "1M"; - part-type = "primary"; - flags = ["bios_grub"]; - } - { - name = "ESP"; - start = "1M"; - end = "1G"; - bootable = true; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot/efis/nvme-SHPP41-500GM_SSB4N6719101A4N22"; - }; - } - { - name = "zfsboot"; - start = "1G"; - end = "5G"; - content = { - type = "zfs"; - pool = "bpool"; - }; - } - { - name = "swap"; - start = "5G"; - end = "21G"; - content = { - type = "swap"; - randomEncryption = true; - }; - } - { - name = "zfsroot"; - start = "21G"; - end = "100%"; - content = { - type = "zfs"; - pool = "rpool"; - }; - } - ]; +{disko, ...}: { + imports = [disko.nixosModules.disko]; + disko.devices = { + disk = { + nvme0 = { + type = "disk"; + device = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N22"; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + name = "boot"; + start = "0"; + end = "1M"; + part-type = "primary"; + flags = ["bios_grub"]; + } + { + name = "ESP"; + start = "1M"; + end = "1G"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot/efis/nvme-SHPP41-500GM_SSB4N6719101A4N22"; + }; + } + { + name = "zfsboot"; + start = "1G"; + end = "5G"; + content = { + type = "zfs"; + pool = "bpool"; + }; + } + { + name = "swap"; + start = "5G"; + end = "21G"; + content = { + type = "swap"; + randomEncryption = true; + }; + } + { + name = "zfsroot"; + start = "21G"; + end = "100%"; + content = { + type = "zfs"; + pool = "rpool"; + }; + } + ]; + }; + }; + nvme1 = { + type = "disk"; + device = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N0E"; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + name = "BIOS"; + start = "0"; + end = "1M"; + part-type = "primary"; + flags = ["bios_grub"]; + } + { + name = "ESP"; + start = "1M"; + end = "1G"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot/efis/nvme-SHPP41-500GM_SSB4N6719101A4N0E"; + }; + } + { + name = "zfsboot"; + start = "1G"; + end = "5G"; + content = { + type = "zfs"; + pool = "bpool"; + }; + } + { + name = "swap"; + start = "5G"; + end = "21G"; + content = { + type = "swap"; + randomEncryption = true; + }; + } + { + name = "zfsroot"; + start = "21G"; + end = "100%"; + content = { + type = "zfs"; + pool = "rpool"; + }; + } + ]; + }; }; }; - nvme1 = { - type = "disk"; - device = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N0E"; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "BIOS"; - start = "0"; - end = "1M"; - part-type = "primary"; - flags = ["bios_grub"]; - } - { - name = "ESP"; - start = "1M"; - end = "1G"; - bootable = true; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot/efis/nvme-SHPP41-500GM_SSB4N6719101A4N0E"; - }; - } - { - name = "zfsboot"; - start = "1G"; - end = "5G"; - content = { - type = "zfs"; - pool = "bpool"; - }; - } - { - name = "swap"; - start = "5G"; - end = "21G"; - content = { - type = "swap"; - randomEncryption = true; - }; - } - { - name = "zfsroot"; - start = "21G"; - end = "100%"; - content = { - type = "zfs"; - pool = "rpool"; - }; - } - ]; - }; - }; - }; - zpool = { - rpool = { - type = "zpool"; - mode = "mirror"; - rootFsOptions = { - acltype = "posixacl"; - compression = "zstd"; - dnodesize = "auto"; - normalization = "formD"; - relatime = "on"; - xattr = "sa"; - encryption = "on"; - keyformat = "passphrase"; - keylocation = "prompt"; - }; - options = { - ashift = "12"; - autotrim = "on"; - }; + zpool = { + rpool = { + type = "zpool"; + mode = "mirror"; + rootFsOptions = { + acltype = "posixacl"; + compression = "zstd"; + dnodesize = "auto"; + normalization = "formD"; + relatime = "on"; + xattr = "sa"; + encryption = "on"; + keyformat = "passphrase"; + keylocation = "prompt"; + }; + options = { + ashift = "12"; + autotrim = "on"; + }; - datasets = { - "root" = { - type = "zfs_fs"; - options.mountpoint = "legacy"; - mountpoint = "/"; - }; - "nix" = { - type = "zfs_fs"; - options.mountpoint = "legacy"; - mountpoint = "/nix"; - }; - "var" = { - type = "zfs_fs"; - options.mountpoint = "legacy"; - mountpoint = "/var"; - }; - "persist" = { - type = "zfs_fs"; - options.mountpoint = "legacy"; - mountpoint = "/persist"; - }; - "home" = { - type = "zfs_fs"; - options.mountpoint = "legacy"; - mountpoint = "/home"; + datasets = { + "root" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/"; + }; + "nix" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/nix"; + }; + "var" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/var"; + }; + "persist" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/persist"; + }; + "home" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/home"; + }; }; }; - }; - bpool = { - type = "zpool"; - mode = "mirror"; - rootFsOptions = { - acltype = "posixacl"; - compression = "lz4"; - devices = "off"; - normalization = "formD"; - relatime = "on"; - xattr = "sa"; - canmount = "off"; - }; + bpool = { + type = "zpool"; + mode = "mirror"; + rootFsOptions = { + acltype = "posixacl"; + compression = "lz4"; + devices = "off"; + normalization = "formD"; + relatime = "on"; + xattr = "sa"; + canmount = "off"; + }; - options = { - compatibility = "grub2"; - ashift = "12"; - autotrim = "on"; - }; - datasets = { - "boot" = { - type = "zfs_fs"; - options.mountpoint = "legacy"; - mountpoint = "/boot"; + options = { + compatibility = "grub2"; + ashift = "12"; + autotrim = "on"; + }; + datasets = { + "boot" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/boot"; + }; }; }; }; diff --git a/systems/moms-laptop/default.nix b/systems/moms-laptop/default.nix index dfa3fe7..4e16df8 100644 --- a/systems/moms-laptop/default.nix +++ b/systems/moms-laptop/default.nix @@ -6,10 +6,9 @@ inputs: { }: { imports = [ (import ./printing.nix inputs) + (import ./disko.nix inputs) ]; - disko.devices = import ./disko.nix; - localModules = { DM = { lightdm.enable = true; diff --git a/systems/moms-laptop/disko.nix b/systems/moms-laptop/disko.nix index 2b20e41..4e276dc 100644 --- a/systems/moms-laptop/disko.nix +++ b/systems/moms-laptop/disko.nix @@ -1,37 +1,40 @@ -_: { - disk.sda = { - device = "/dev/disk/by-id/ata-WDC_WDS240G2G0A-00JH30_180936803144"; - type = "disk"; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - type = "partition"; - name = "ESP"; - start = "1MiB"; - end = "1GiB"; - bootable = true; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - } - { - name = "root"; - type = "partition"; - start = "1GiB"; - end = "100%"; - part-type = "primary"; - bootable = true; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - } - ]; +{disko, ...}: { + imports = [disko.nixosModules.disko]; + disko.devices = { + disk.sda = { + device = "/dev/disk/by-id/ata-WDC_WDS240G2G0A-00JH30_180936803144"; + type = "disk"; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + type = "partition"; + name = "ESP"; + start = "1MiB"; + end = "1GiB"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + } + { + name = "root"; + type = "partition"; + start = "1GiB"; + end = "100%"; + part-type = "primary"; + bootable = true; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + } + ]; + }; }; }; }