From f86be644309028046732c254fb5d0e80bc58dfff Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Mon, 8 Aug 2022 03:32:09 -0600 Subject: sys: move options to own source file --- sys/options.nix | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 sys/options.nix (limited to 'sys/options.nix') 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; + }; + }; + }; + }); + }; + }; + }; + }; + }; + }; +} -- cgit v1.2.3