From 6b1bd3a50c52ac431da2ac84d1ce0f5bca9aacec Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 8 Jul 2024 01:47:23 +0200 Subject: [PATCH] Centralize default settings --- lib/modules/partition.nix | 41 +++---------------- profiles/DerGeret/Arch/config.nix | 2 +- profiles/DerGeret/config.nix | 2 +- .../OS => profiles/Generic/Arch}/config.nix | 2 +- profiles/Generic/config.nix | 36 ++++++++++++++++ profiles/ManuSurface/Arch/config.nix | 6 +-- profiles/ManuSurface/config.nix | 9 ++++ 7 files changed, 54 insertions(+), 44 deletions(-) rename {scripts/Arch/OS => profiles/Generic/Arch}/config.nix (74%) create mode 100644 profiles/Generic/config.nix create mode 100644 profiles/ManuSurface/config.nix diff --git a/lib/modules/partition.nix b/lib/modules/partition.nix index b6263056..8cc29c6d 100644 --- a/lib/modules/partition.nix +++ b/lib/modules/partition.nix @@ -1,36 +1,5 @@ -{ ... }: - let - fs = import ./partition/fs.nix; - in { - imports = [ - ./partition/disks.nix - ]; - - config = { - partition = { - os = { - partitions = { - Boot = { - index = 1; - type = "uefi"; - size = "+1G"; - format = fs.fat32; - mountPoint = "/boot"; - }; - - Swap = { - index = 2; - type = "swap"; - }; - - OS = { - index = 3; - type = "linux"; - format = fs.ext4; - mountPoint = "/"; - }; - }; - }; - }; - }; - } +{ ... }: { + imports = [ + ./partition/disks.nix + ]; +} diff --git a/profiles/DerGeret/Arch/config.nix b/profiles/DerGeret/Arch/config.nix index 29d74685..e3d0e0b5 100644 --- a/profiles/DerGeret/Arch/config.nix +++ b/profiles/DerGeret/Arch/config.nix @@ -1,6 +1,6 @@ { ... }: { imports = [ ../partition.nix - ../../../scripts/Arch/OS/config.nix + ../../Generic/Arch/config.nix ]; } diff --git a/profiles/DerGeret/config.nix b/profiles/DerGeret/config.nix index e5849aaa..30f604c9 100644 --- a/profiles/DerGeret/config.nix +++ b/profiles/DerGeret/config.nix @@ -1,6 +1,6 @@ { ... }: { imports = [ - ../../lib/modules/partition.nix + ../Generic/config.nix ]; config = { diff --git a/scripts/Arch/OS/config.nix b/profiles/Generic/Arch/config.nix similarity index 74% rename from scripts/Arch/OS/config.nix rename to profiles/Generic/Arch/config.nix index 347a76cd..055d3285 100644 --- a/scripts/Arch/OS/config.nix +++ b/profiles/Generic/Arch/config.nix @@ -1,6 +1,6 @@ { ... }: { imports = [ - ../../../lib/modules/partition.nix + ../config.nix ]; config = { diff --git a/profiles/Generic/config.nix b/profiles/Generic/config.nix new file mode 100644 index 00000000..7f9a4d2d --- /dev/null +++ b/profiles/Generic/config.nix @@ -0,0 +1,36 @@ +{ ... }: + let + fs = import ../../lib/modules/partition/fs.nix; + in { + imports = [ + ../../lib/modules/partition.nix + ]; + + config = { + partition = { + os = { + partitions = { + Boot = { + index = 1; + type = "uefi"; + size = "+1G"; + format = fs.fat32; + mountPoint = "/boot"; + }; + + Swap = { + index = 2; + type = "swap"; + }; + + OS = { + index = 3; + type = "linux"; + format = fs.ext4; + mountPoint = "/"; + }; + }; + }; + }; + }; + } diff --git a/profiles/ManuSurface/Arch/config.nix b/profiles/ManuSurface/Arch/config.nix index b7018322..cc9c3e25 100644 --- a/profiles/ManuSurface/Arch/config.nix +++ b/profiles/ManuSurface/Arch/config.nix @@ -1,9 +1,5 @@ { ... }: { imports = [ - ../../../scripts/Arch/OS/config.nix + ../config.nix ]; - - config = { - partition.os.deviceName = "nvme0n1"; - }; } diff --git a/profiles/ManuSurface/config.nix b/profiles/ManuSurface/config.nix new file mode 100644 index 00000000..c092d251 --- /dev/null +++ b/profiles/ManuSurface/config.nix @@ -0,0 +1,9 @@ +{ ... }: { + imports = [ + ../Generic/Arch/config.nix + ]; + + config = { + partition.os.deviceName = "nvme0n1"; + }; +}