summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-08-08 03:32:09 -0600
committerAlejandro Soto <alejandro@34project.org>2022-08-08 03:33:23 -0600
commitf86be644309028046732c254fb5d0e80bc58dfff (patch)
tree2e949c9a4fda1c47ea8ff2d8476742a2c24b7712
parent089112aa64aa506fe14427955d0eeb546c86d907 (diff)
sys: move options to own source file
-rw-r--r--sys/default.nix186
-rw-r--r--sys/options.nix164
2 files changed, 165 insertions, 185 deletions
diff --git a/sys/default.nix b/sys/default.nix
index e02516d..b3cb34b 100644
--- a/sys/default.nix
+++ b/sys/default.nix
@@ -3,191 +3,7 @@
with lib; let
cfg = config.local;
in {
- imports = [ "${modulesPath}/installer/scan/not-detected.nix" ];
-
- options.local = with lib.types; {
- hostname = mkOption {
- type = str;
- };
-
- portable = mkOption {
- type = bool;
- };
-
- loader = mkOption {
- type = enum [ "grub" "systemd-boot" ];
- };
-
- cpuVendor = mkOption {
- type = enum [ "amd" "intel" ];
- };
-
- canTouchEfiVariables = mkOption {
- type = bool;
- };
-
- dhcpInterface = mkOption {
- type = nullOr str;
- default = null;
- };
-
- videoDrivers = mkOption {
- type = listOf str;
- };
-
- initrdModules = mkOption {
- type = listOf str;
- };
-
- snapperSubvols = mkOption {
- type = attrsOf str;
- default = {};
- };
-
- crypt = mkOption {
- default = {};
-
- type = submodule {
- options = {
- toplevel = mkOption {
- default = null;
-
- type = nullOr (submodule {
- options = {
- device = mkOption {
- type = str;
- };
-
- target = mkOption {
- type = str;
- };
-
- headerFromBoot = mkOption {
- type = str;
- };
- };
- });
- };
-
- aux = mkOption {
- default = [];
- type = listOf (submodule {
- options = {
- device = mkOption {
- type = str;
- };
-
- target = mkOption {
- type = str;
- };
-
- header = mkOption {
- type = str;
- };
-
- keyfile = mkOption {
- type = str;
- };
- };
- });
- };
- };
- };
- };
-
- fs = mkOption {
- type = submodule {
- options = {
- boot = mkOption {
- type = submodule {
- options = {
- device = mkOption {
- type = str;
- };
- };
- };
- };
-
- btrfs = mkOption {
- default = [];
-
- type = attrsOf (submodule {
- options = {
- device = mkOption {
- type = str;
- };
-
- subvol = mkOption {
- type = str;
- };
-
- ssd = mkOption {
- type = bool;
- };
-
- snapper = mkOption {
- type = nullOr str;
- default = null;
- };
- };
- });
- };
-
- layout = mkOption {
- default = {};
-
- type = submodule {
- options = {
- sysHddBtrfs = mkOption {
- default = null;
-
- type = nullOr (submodule {
- options = {
- sys = mkOption {
- type = submodule {
- options = {
- device = mkOption {
- type = str;
- };
-
- ssd = mkOption {
- type = bool;
- };
-
- root = mkOption {
- type = str;
- };
-
- toplevel = mkOption {
- type = str;
- };
- };
- };
- };
-
- hdd = mkOption {
- type = submodule {
- options = {
- device = mkOption {
- type = str;
- };
-
- home = mkOption {
- type = str;
- };
- };
- };
- };
- };
- });
- };
- };
- };
- };
- };
- };
- };
- };
+ imports = [ "${modulesPath}/installer/scan/not-detected.nix" ./options.nix ];
config = {
nixpkgs.overlays = [ self.overlay ];
diff --git a/sys/options.nix b/sys/options.nix
new file mode 100644
index 0000000..789b489
--- /dev/null
+++ b/sys/options.nix
@@ -0,0 +1,164 @@
+{ lib, ... }:
+with lib.types; let
+ inherit (lib) mkOption;
+in {
+ options.local = {
+ hostname = mkOption {
+ type = str;
+ };
+
+ portable = mkOption {
+ type = bool;
+ };
+
+ loader = mkOption {
+ type = enum [ "grub" "systemd-boot" ];
+ };
+
+ cpuVendor = mkOption {
+ type = enum [ "amd" "intel" ];
+ };
+
+ canTouchEfiVariables = mkOption {
+ type = bool;
+ };
+
+ dhcpInterface = mkOption {
+ type = nullOr str;
+ default = null;
+ };
+
+ videoDrivers = mkOption {
+ type = listOf str;
+ };
+
+ initrdModules = mkOption {
+ type = listOf str;
+ };
+
+ snapperSubvols = mkOption {
+ type = attrsOf str;
+ default = {};
+ };
+
+ crypt = {
+ toplevel = mkOption {
+ default = null;
+
+ type = nullOr (submodule {
+ options = {
+ device = mkOption {
+ type = str;
+ };
+
+ target = mkOption {
+ type = str;
+ };
+
+ headerFromBoot = mkOption {
+ type = str;
+ };
+ };
+ });
+ };
+
+ aux = mkOption {
+ default = [];
+ type = listOf (submodule {
+ options = {
+ device = mkOption {
+ type = str;
+ };
+
+ target = mkOption {
+ type = str;
+ };
+
+ header = mkOption {
+ type = str;
+ };
+
+ keyfile = mkOption {
+ type = str;
+ };
+ };
+ });
+ };
+ };
+
+ fs = {
+ boot.device = mkOption {
+ type = str;
+ };
+
+ btrfs = mkOption {
+ default = [];
+
+ type = attrsOf (submodule {
+ options = {
+ device = mkOption {
+ type = str;
+ };
+
+ subvol = mkOption {
+ type = str;
+ };
+
+ ssd = mkOption {
+ type = bool;
+ };
+
+ snapper = mkOption {
+ type = nullOr str;
+ default = null;
+ };
+ };
+ });
+ };
+
+ layout = mkOption {
+ default = {};
+
+ type = submodule {
+ options = {
+ sysHddBtrfs = mkOption {
+ default = null;
+
+ type = nullOr (submodule {
+ options = {
+ sys = {
+ device = mkOption {
+ type = str;
+ };
+
+ ssd = mkOption {
+ type = bool;
+ };
+
+ root = mkOption {
+ type = str;
+ };
+
+ toplevel = mkOption {
+ type = str;
+ };
+ };
+
+ hdd = {
+ device = mkOption {
+ type = str;
+ };
+
+ home = mkOption {
+ type = str;
+ };
+ };
+ };
+ });
+ };
+ };
+ };
+ };
+ };
+ };
+}