From ee98cdf6f0a016728a9099ff29f5f80c940d2047 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sat, 16 Nov 2024 04:43:59 +0300 Subject: [PATCH] Split modules to option and config. --- {module => config}/AmdCompute.nix | 2 - {module => config}/AmdCpu.nix | 6 -- {module => config}/AmdGpu.nix | 3 - {module => config}/AutoUpdateSigned.nix | 4 - {module => config}/Bluetooth.nix | 2 - {module => config}/Brightness.nix | 2 - {module => config}/DisplayManager.nix | 2 - {module => config}/Distrobox.nix | 4 - {module => config}/Docker.nix | 12 --- {module => config}/Ftpd.nix | 12 +-- {module => config}/Gnome.nix | 2 - {module => config}/IntelCpu.nix | 6 -- {module => config}/Kernel.nix | 17 ---- {module => config}/Keyd.nix | 4 - {module => config}/Ollama.nix | 12 --- {module => config}/Package.nix | 10 -- {module => config}/Podman.nix | 4 - {module => config}/Polkit.nix | 2 - {module => config}/Portal.nix | 2 - {module => config}/PowerlimitThinkpad.nix | 20 ---- {module => config}/Powersave.nix | 18 ---- {module => config}/Print.nix | 3 - {module => config}/Realtime.nix | 2 - {module => config}/RemoteBuild.nix | 5 - {module => config}/Sound.nix | 2 - {module => config}/Sway.nix | 8 -- {module => config}/Tablet.nix | 2 - {module => config}/VirtManager.nix | 2 - {module => config}/Waybar.nix | 2 - {module => config}/Wayland.nix | 3 - flake.nix | 14 +-- home/config/foot/default.nix | 2 +- home/config/fuzzel/default.nix | 2 +- home/config/nvim/module/plugin/Gen.nix | 2 +- home/config/sway/default.nix | 2 +- home/config/sway/module/Input.nix | 4 +- home/config/waybar/config/default.nix | 4 +- module/Dpi.nix | 14 --- module/Style.nix | 115 --------------------- option/AmdCompute.nix | 6 ++ option/AmdCpu.nix | 9 ++ option/AmdGpu.nix | 6 ++ option/AutoUpdateSigned.nix | 6 ++ option/Bluetooth.nix | 6 ++ option/Brightness.nix | 6 ++ option/DisplayManager.nix | 6 ++ option/Distrobox.nix | 6 ++ option/Docker.nix | 16 +++ option/Dpi.nix | 10 ++ option/Ftpd.nix | 12 +++ option/Gnome.nix | 6 ++ {module => option}/Hwmon.nix | 6 +- option/IntelCpu.nix | 9 ++ option/Kernel.nix | 20 ++++ {module => option}/Keyboard.nix | 6 +- option/Keyd.nix | 6 ++ option/Ollama.nix | 19 ++++ option/Package.nix | 14 +++ option/Podman.nix | 6 ++ option/Polkit.nix | 6 ++ option/Portal.nix | 6 ++ option/PowerlimitThinkpad.nix | 24 +++++ option/Powersave.nix | 22 ++++ option/Print.nix | 6 ++ option/Realtime.nix | 6 ++ option/RemoteBuild.nix | 9 ++ option/Sound.nix | 6 ++ option/Style.nix | 117 ++++++++++++++++++++++ option/Sway.nix | 12 +++ option/Tablet.nix | 6 ++ option/VirtManager.nix | 6 ++ {module => option}/Wallpaper.nix | 1 + option/Waybar.nix | 6 ++ option/Wayland.nix | 6 ++ 74 files changed, 429 insertions(+), 325 deletions(-) rename {module => config}/AmdCompute.nix (76%) rename {module => config}/AmdCpu.nix (76%) rename {module => config}/AmdGpu.nix (87%) rename {module => config}/AutoUpdateSigned.nix (93%) rename {module => config}/Bluetooth.nix (72%) rename {module => config}/Brightness.nix (62%) rename {module => config}/DisplayManager.nix (77%) rename {module => config}/Distrobox.nix (75%) rename {module => config}/Docker.nix (67%) rename {module => config}/Ftpd.nix (76%) rename {module => config}/Gnome.nix (95%) rename {module => config}/IntelCpu.nix (73%) rename {module => config}/Kernel.nix (85%) rename {module => config}/Keyd.nix (96%) rename {module => config}/Ollama.nix (78%) rename {module => config}/Package.nix (83%) rename {module => config}/Podman.nix (82%) rename {module => config}/Polkit.nix (89%) rename {module => config}/Portal.nix (85%) rename {module => config}/PowerlimitThinkpad.nix (80%) rename {module => config}/Powersave.nix (78%) rename {module => config}/Print.nix (73%) rename {module => config}/Realtime.nix (75%) rename {module => config}/RemoteBuild.nix (94%) rename {module => config}/Sound.nix (82%) rename {module => config}/Sway.nix (79%) rename {module => config}/Tablet.nix (73%) rename {module => config}/VirtManager.nix (87%) rename {module => config}/Waybar.nix (71%) rename {module => config}/Wayland.nix (89%) delete mode 100644 module/Dpi.nix delete mode 100644 module/Style.nix create mode 100644 option/AmdCompute.nix create mode 100644 option/AmdCpu.nix create mode 100644 option/AmdGpu.nix create mode 100644 option/AutoUpdateSigned.nix create mode 100644 option/Bluetooth.nix create mode 100644 option/Brightness.nix create mode 100644 option/DisplayManager.nix create mode 100644 option/Distrobox.nix create mode 100644 option/Docker.nix create mode 100644 option/Dpi.nix create mode 100644 option/Ftpd.nix create mode 100644 option/Gnome.nix rename {module => option}/Hwmon.nix (79%) create mode 100644 option/IntelCpu.nix create mode 100644 option/Kernel.nix rename {module => option}/Keyboard.nix (80%) create mode 100644 option/Keyd.nix create mode 100644 option/Ollama.nix create mode 100644 option/Package.nix create mode 100644 option/Podman.nix create mode 100644 option/Polkit.nix create mode 100644 option/Portal.nix create mode 100644 option/PowerlimitThinkpad.nix create mode 100644 option/Powersave.nix create mode 100644 option/Print.nix create mode 100644 option/Realtime.nix create mode 100644 option/RemoteBuild.nix create mode 100644 option/Sound.nix create mode 100644 option/Style.nix create mode 100644 option/Sway.nix create mode 100644 option/Tablet.nix create mode 100644 option/VirtManager.nix rename {module => option}/Wallpaper.nix (93%) create mode 100644 option/Waybar.nix create mode 100644 option/Wayland.nix diff --git a/module/AmdCompute.nix b/config/AmdCompute.nix similarity index 76% rename from module/AmdCompute.nix rename to config/AmdCompute.nix index 85b7c75e..cd2eb8b8 100644 --- a/module/AmdCompute.nix +++ b/config/AmdCompute.nix @@ -6,8 +6,6 @@ }: let cfg = config.module.amd.compute; in { - options.module.amd.compute.enable = lib.mkEnableOption "the AMD Rocm support i.e. for Blender."; - config = lib.mkIf cfg.enable { nixpkgs.config.rocmSupport = true; systemd.tmpfiles.rules = [ "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ]; diff --git a/module/AmdCpu.nix b/config/AmdCpu.nix similarity index 76% rename from module/AmdCpu.nix rename to config/AmdCpu.nix index 61768d5a..e732eb56 100644 --- a/module/AmdCpu.nix +++ b/config/AmdCpu.nix @@ -1,7 +1,6 @@ { config, lib, - pkgs, ... }: let cfg = config.module.amd.cpu; @@ -10,11 +9,6 @@ disableCmd = "1"; enableCmd = "0"; in { - options.module.amd.cpu = { - enable = lib.mkEnableOption "the AMD Cpu support."; - powersave = lib.mkEnableOption "the AMD Cpu powersave."; - }; - config = lib.mkIf cfg.enable (lib.mkMerge [ { boot.kernelModules = [ "kvm-amd" ]; diff --git a/module/AmdGpu.nix b/config/AmdGpu.nix similarity index 87% rename from module/AmdGpu.nix rename to config/AmdGpu.nix index 5d92f98f..33840827 100644 --- a/module/AmdGpu.nix +++ b/config/AmdGpu.nix @@ -1,13 +1,10 @@ { config, lib, - pkgs, ... }: let cfg = config.module.amd.gpu; in { - options.module.amd.gpu.enable = lib.mkEnableOption "the AMD Gpu support."; - config = lib.mkIf cfg.enable { environment.variables.AMD_VULKAN_ICD = "RADV"; boot.initrd.kernelModules = [ diff --git a/module/AutoUpdateSigned.nix b/config/AutoUpdateSigned.nix similarity index 93% rename from module/AutoUpdateSigned.nix rename to config/AutoUpdateSigned.nix index 539186ce..57f64002 100644 --- a/module/AutoUpdateSigned.nix +++ b/config/AutoUpdateSigned.nix @@ -13,10 +13,6 @@ }: let cfg = config.module.autoupdate; in { - options.module.autoupdate = { - enable = lib.mkEnableOption "the system auto-updates."; - }; - config = lib.mkIf cfg.enable { programs.git = { enable = true; diff --git a/module/Bluetooth.nix b/config/Bluetooth.nix similarity index 72% rename from module/Bluetooth.nix rename to config/Bluetooth.nix index 3ada1dad..9954ec78 100644 --- a/module/Bluetooth.nix +++ b/config/Bluetooth.nix @@ -5,8 +5,6 @@ }: let cfg = config.module.bluetooth; in { - options.module.bluetooth.enable = lib.mkEnableOption "the bluetooth support."; - config = lib.mkIf cfg.enable { services.blueman.enable = true; hardware.bluetooth = { diff --git a/module/Brightness.nix b/config/Brightness.nix similarity index 62% rename from module/Brightness.nix rename to config/Brightness.nix index 2e1c0e84..208818c8 100644 --- a/module/Brightness.nix +++ b/config/Brightness.nix @@ -5,8 +5,6 @@ }: let cfg = config.module.brightness; in { - options.module.brightness.enable = lib.mkEnableOption "the brightness control."; - config = lib.mkIf cfg.enable { programs.light.enable = true; }; diff --git a/module/DisplayManager.nix b/config/DisplayManager.nix similarity index 77% rename from module/DisplayManager.nix rename to config/DisplayManager.nix index 293780da..b896e62b 100644 --- a/module/DisplayManager.nix +++ b/config/DisplayManager.nix @@ -5,8 +5,6 @@ }: let cfg = config.module.dm; in { - options.module.dm.enable = lib.mkEnableOption "the display manager."; - config = lib.mkIf cfg.enable { services.xserver = { enable = true; diff --git a/module/Distrobox.nix b/config/Distrobox.nix similarity index 75% rename from module/Distrobox.nix rename to config/Distrobox.nix index 9e68985b..5cf0464a 100644 --- a/module/Distrobox.nix +++ b/config/Distrobox.nix @@ -6,10 +6,6 @@ }: let cfg = config.module.distrobox; in { - options.module.distrobox = { - enable = lib.mkEnableOption "the distrobox."; - }; - config = lib.mkIf cfg.enable { # Distrobox works best with Podman, so enable it here. module.podman.enable = true; diff --git a/module/Docker.nix b/config/Docker.nix similarity index 67% rename from module/Docker.nix rename to config/Docker.nix index 657f9250..f1462197 100644 --- a/module/Docker.nix +++ b/config/Docker.nix @@ -5,18 +5,6 @@ }: let cfg = config.module.docker; in { - options.module.docker = { - enable = lib.mkEnableOption "the docker."; - rootless = lib.mkOption { - default = false; - type = lib.types.bool; - }; - autostart = lib.mkOption { - default = false; - type = lib.types.bool; - }; - }; - config = lib.mkIf cfg.enable (lib.mkMerge [ { virtualisation.docker.enable = true; diff --git a/module/Ftpd.nix b/config/Ftpd.nix similarity index 76% rename from module/Ftpd.nix rename to config/Ftpd.nix index d9386732..694ac8a3 100644 --- a/module/Ftpd.nix +++ b/config/Ftpd.nix @@ -1,21 +1,11 @@ { config, lib, - pkgs, util, ... }: let cfg = config.module.ftpd; -in - { - options.module.ftpd = { - enable = lib.mkEnableOption "the FTP server"; - storage = lib.mkOption { - default = null; - type = lib.types.str; - }; - }; - +in { config = lib.mkIf cfg.enable { services.vsftpd = { enable = true; diff --git a/module/Gnome.nix b/config/Gnome.nix similarity index 95% rename from module/Gnome.nix rename to config/Gnome.nix index bc067151..e56d8495 100644 --- a/module/Gnome.nix +++ b/config/Gnome.nix @@ -7,8 +7,6 @@ }: let cfg = config.module.gnome; in { - options.module.gnome.enable = lib.mkEnableOption "the Gnome DE."; - config = lib.mkIf cfg.enable { module = { dm.enable = true; diff --git a/module/IntelCpu.nix b/config/IntelCpu.nix similarity index 73% rename from module/IntelCpu.nix rename to config/IntelCpu.nix index e17ff123..9f2b6443 100644 --- a/module/IntelCpu.nix +++ b/config/IntelCpu.nix @@ -2,7 +2,6 @@ { config, lib, - pkgs, ... }: let cfg = config.module.intel.cpu; @@ -11,11 +10,6 @@ disableCmd = "0"; enableCmd = "1"; in { - options.module.intel.cpu = { - enable = lib.mkEnableOption "the support for Intel CPUs"; - powersave = lib.mkEnableOption "the Intel CPU powersave."; - }; - config = lib.mkIf cfg.enable (lib.mkMerge [ { boot.kernelModules = [ diff --git a/module/Kernel.nix b/config/Kernel.nix similarity index 85% rename from module/Kernel.nix rename to config/Kernel.nix index 30df1720..a63c3ec9 100644 --- a/module/Kernel.nix +++ b/config/Kernel.nix @@ -1,28 +1,11 @@ { config, lib, - pkgs, pkgsUnstable, ... }: let cfg = config.module.kernel; in { - options.module.kernel = { - enable = lib.mkEnableOption "the kernel tweaks."; - hardening = lib.mkOption { - default = false; - type = lib.types.bool; - }; - hotspotTtlBypass = lib.mkOption { - default = false; - type = lib.types.bool; - }; - latest = lib.mkOption { - default = false; - type = lib.types.bool; - }; - }; - config = lib.mkIf cfg.enable (lib.mkMerge [ { boot.kernel.sysctl = { diff --git a/module/Keyd.nix b/config/Keyd.nix similarity index 96% rename from module/Keyd.nix rename to config/Keyd.nix index 1539f570..557887dd 100644 --- a/module/Keyd.nix +++ b/config/Keyd.nix @@ -6,10 +6,6 @@ }: let cfg = config.module.keyd; in { - options.module.keyd = { - enable = lib.mkEnableOption "the keyboard remaps."; - }; - config = lib.mkIf cfg.enable { environment.systemPackages = with pkgs; [ keyd diff --git a/module/Ollama.nix b/config/Ollama.nix similarity index 78% rename from module/Ollama.nix rename to config/Ollama.nix index 8011df22..31146367 100644 --- a/module/Ollama.nix +++ b/config/Ollama.nix @@ -8,18 +8,6 @@ }: let cfg = config.module.ollama; in { - options.module.ollama = { - enable = lib.mkEnableOption "the local LLM server."; - models = lib.mkOption { - default = [ cfg.primaryModel ]; - type = with lib.types; listOf str; - }; - primaryModel = lib.mkOption { - default = "llama3.2"; - type = lib.types.str; - }; - }; - config = lib.mkIf cfg.enable { # Specify default model. environment.variables.OLLAMA_MODEL = cfg.primaryModel; diff --git a/module/Package.nix b/config/Package.nix similarity index 83% rename from module/Package.nix rename to config/Package.nix index 76061d5e..0e5efd10 100644 --- a/module/Package.nix +++ b/config/Package.nix @@ -8,16 +8,6 @@ cfg = config.module.package; package = import args; in { - options.module.package = { - common.enable = lib.mkEnableOption "Common Apps."; - core.enable = lib.mkEnableOption "Core apps."; - creative.enable = lib.mkEnableOption "Creative Apps."; - desktop.enable = lib.mkEnableOption "Desktop Apps."; - dev.enable = lib.mkEnableOption "Dev Apps."; - extra.enable = lib.mkEnableOption "Extra Apps."; - gaming.enable = lib.mkEnableOption "Gaming Apps."; - }; - config = lib.mkMerge [ # Core apps. (lib.mkIf cfg.core.enable { diff --git a/module/Podman.nix b/config/Podman.nix similarity index 82% rename from module/Podman.nix rename to config/Podman.nix index 614b4ad9..878fda0f 100644 --- a/module/Podman.nix +++ b/config/Podman.nix @@ -5,10 +5,6 @@ }: let cfg = config.module.podman; in { - options.module.podman = { - enable = lib.mkEnableOption "the OCI Podman."; - }; - config = lib.mkIf cfg.enable { virtualisation.podman = { enable = true; diff --git a/module/Polkit.nix b/config/Polkit.nix similarity index 89% rename from module/Polkit.nix rename to config/Polkit.nix index d664311c..fa0461b4 100644 --- a/module/Polkit.nix +++ b/config/Polkit.nix @@ -7,8 +7,6 @@ }: let cfg = config.module.polkit; in { - options.module.polkit.enable = lib.mkEnableOption "the polkit."; - config = lib.mkIf cfg.enable { security.polkit.enable = true; systemd = { diff --git a/module/Portal.nix b/config/Portal.nix similarity index 85% rename from module/Portal.nix rename to config/Portal.nix index 1c1fa81e..78798714 100644 --- a/module/Portal.nix +++ b/config/Portal.nix @@ -7,8 +7,6 @@ }: let cfg = config.module.portal; in { - options.module.portal.enable = lib.mkEnableOption "the portals."; - config = lib.mkIf cfg.enable { xdg.portal = { enable = true; diff --git a/module/PowerlimitThinkpad.nix b/config/PowerlimitThinkpad.nix similarity index 80% rename from module/PowerlimitThinkpad.nix rename to config/PowerlimitThinkpad.nix index 11bcb755..30b31d47 100644 --- a/module/PowerlimitThinkpad.nix +++ b/config/PowerlimitThinkpad.nix @@ -39,26 +39,6 @@ ''${@} ''); in { - options.module.powerlimit.thinkpad = { - enable = lib.mkEnableOption "the powerlimit service"; - onMin = lib.mkOption { - default = 40; - type = lib.types.int; - }; - onMax = lib.mkOption { - default = 80; - type = lib.types.int; - }; - offMin = lib.mkOption { - default = 90; - type = lib.types.int; - }; - offMax = lib.mkOption { - default = 95; - type = lib.types.int; - }; - }; - config = lib.mkIf cfg.enable { environment.systemPackages = [ script diff --git a/module/Powersave.nix b/config/Powersave.nix similarity index 78% rename from module/Powersave.nix rename to config/Powersave.nix index ad200655..b2208c69 100644 --- a/module/Powersave.nix +++ b/config/Powersave.nix @@ -33,24 +33,6 @@ ''${@} ''); in { - options.module.powersave = { - enable = lib.mkEnableOption "the powersave"; - cpu.boost = { - disableCmd = lib.mkOption { - default = null; - type = lib.types.str; - }; - enableCmd = lib.mkOption { - default = null; - type = lib.types.str; - }; - controlFile = lib.mkOption { - default = null; - type = lib.types.str; - }; - }; - }; - config = lib.mkIf cfg.enable { environment.systemPackages = [ script diff --git a/module/Print.nix b/config/Print.nix similarity index 73% rename from module/Print.nix rename to config/Print.nix index 170d7cbc..defa19fa 100644 --- a/module/Print.nix +++ b/config/Print.nix @@ -1,14 +1,11 @@ { config, lib, - pkgs, util, ... }: let cfg = config.module.print; in { - options.module.print.enable = lib.mkEnableOption "the support for printers."; - config = lib.mkIf cfg.enable { services.printing = { enable = true; diff --git a/module/Realtime.nix b/config/Realtime.nix similarity index 75% rename from module/Realtime.nix rename to config/Realtime.nix index fbeb1caf..485e7849 100644 --- a/module/Realtime.nix +++ b/config/Realtime.nix @@ -6,8 +6,6 @@ }: let cfg = config.module.realtime; in { - options.module.realtime.enable = lib.mkEnableOption "the realtime access."; - config = lib.mkIf cfg.enable { security.pam.loginLimits = [{ domain = "@users"; diff --git a/module/RemoteBuild.nix b/config/RemoteBuild.nix similarity index 94% rename from module/RemoteBuild.nix rename to config/RemoteBuild.nix index 4ecc0ce9..59898f32 100644 --- a/module/RemoteBuild.nix +++ b/config/RemoteBuild.nix @@ -9,11 +9,6 @@ serverKeyPath = "/root/.nixbuilder"; serverSshPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFqr7zKGOy/2bbAQCD85Ol+NoGGtvdMbSy3jGb98jM+f"; # Use ssh-keyscan. in { - options.module.builder = { - server.enable = lib.mkEnableOption "the builder server."; - client.enable = lib.mkEnableOption "the builder client."; - }; - config = lib.mkMerge [ (lib.mkIf cfg.server.enable { # Service that generates new key on boot if not present. diff --git a/module/Sound.nix b/config/Sound.nix similarity index 82% rename from module/Sound.nix rename to config/Sound.nix index 8a54e9a1..4a2cbe09 100644 --- a/module/Sound.nix +++ b/config/Sound.nix @@ -5,8 +5,6 @@ }: let cfg = config.module.sound; in { - options.module.sound.enable = lib.mkEnableOption "the sound."; - config = lib.mkIf cfg.enable { hardware.pulseaudio.enable = false; security.rtkit.enable = true; diff --git a/module/Sway.nix b/config/Sway.nix similarity index 79% rename from module/Sway.nix rename to config/Sway.nix index 2190bfee..41e90b6a 100644 --- a/module/Sway.nix +++ b/config/Sway.nix @@ -6,14 +6,6 @@ }: let cfg = config.module.sway; in { - options.module.sway = { - enable = lib.mkEnableOption "the Sway WM."; - extraConfig = lib.mkOption { - default = ""; - type = lib.types.str; - }; - }; - config = lib.mkIf cfg.enable { services.gnome.gnome-keyring.enable = lib.mkForce false; environment.variables.XDG_CURRENT_DESKTOP = "sway"; diff --git a/module/Tablet.nix b/config/Tablet.nix similarity index 73% rename from module/Tablet.nix rename to config/Tablet.nix index f9a7efbf..2ea82d22 100644 --- a/module/Tablet.nix +++ b/config/Tablet.nix @@ -5,8 +5,6 @@ }: let cfg = config.module.tablet; in { - options.module.tablet.enable = lib.mkEnableOption "the support for tables."; - config = lib.mkIf cfg.enable { hardware.opentabletdriver.enable = true; systemd.user.services.opentabletdriver.wantedBy = [ diff --git a/module/VirtManager.nix b/config/VirtManager.nix similarity index 87% rename from module/VirtManager.nix rename to config/VirtManager.nix index 08f0c3ca..2326f30e 100644 --- a/module/VirtManager.nix +++ b/config/VirtManager.nix @@ -6,8 +6,6 @@ }: let cfg = config.module.virtmanager; in { - options.module.virtmanager.enable = lib.mkEnableOption "the VM support."; - config = lib.mkIf cfg.enable { virtualisation.libvirtd.enable = true; programs.virt-manager.enable = true; diff --git a/module/Waybar.nix b/config/Waybar.nix similarity index 71% rename from module/Waybar.nix rename to config/Waybar.nix index 7e83722d..e6f09f57 100644 --- a/module/Waybar.nix +++ b/config/Waybar.nix @@ -6,8 +6,6 @@ }: let cfg = config.module.waybar; in { - options.module.waybar.enable = lib.mkEnableOption "the Waybar."; - config = lib.mkIf cfg.enable { environment.systemPackages = with pkgs; [ waybar diff --git a/module/Wayland.nix b/config/Wayland.nix similarity index 89% rename from module/Wayland.nix rename to config/Wayland.nix index d9389e81..04a73062 100644 --- a/module/Wayland.nix +++ b/config/Wayland.nix @@ -1,13 +1,10 @@ { config, - lib, pkgs, ... }: let cfg = config.module.wayland; in { - options.module.wayland.enable = lib.mkEnableOption "the wayland."; - config = { programs.xwayland.enable = true; environment = { diff --git a/flake.nix b/flake.nix index d5eda313..0214cbf6 100644 --- a/flake.nix +++ b/flake.nix @@ -70,7 +70,7 @@ ); devShells = let - lib = nixpkgs.lib; + # lib = nixpkgs.lib; pkgs = nixpkgs.legacyPackages.${system}; system = "x86_64-linux"; in { @@ -106,7 +106,8 @@ ] ++ (self.findFiles ./container) ++ (self.findFiles ./host/${system}/${hostname}) - ++ (self.findFiles ./module) + ++ (self.findFiles ./option) + ++ (self.findFiles ./config) ++ (self.findFiles ./overlay) ++ (self.findFiles ./system) ; @@ -134,7 +135,7 @@ ); nixOnDroidConfigurations.default = let - config = self.nixOnDroidConfigurations.default.config; + # config = self.nixOnDroidConfigurations.default.config; lib = nixpkgs.lib; pkgs = nixpkgs.legacyPackages.${system}.pkgs; pkgsMaster = nixpkgsMaster.legacyPackages.${system}.pkgs; @@ -143,12 +144,13 @@ in nix-on-droid.lib.nixOnDroidConfiguration { inherit pkgs; modules = [ - (import ./module/Style.nix { inherit (config.home-manager) config; inherit (self) __findFile; inherit lib pkgs; }) { home.android.enable = true; } { home-manager.config.stylix.autoEnable = lib.mkForce false; } ./home/Android.nix - ./module/Wallpaper.nix - ]; + ] + ++ (self.findFiles ./option) + ++ (self.findFiles ./overlay) + ; extraSpecialArgs = { inherit inputs self pkgsMaster pkgsUnstable; inherit (self) const __findFile; diff --git a/home/config/foot/default.nix b/home/config/foot/default.nix index de32aa3d..dccb86ce 100644 --- a/home/config/foot/default.nix +++ b/home/config/foot/default.nix @@ -4,7 +4,7 @@ ... }: let borderSize = toString config.module.style.window.border; - dpiAware = if (config.module.dpi.aware or false) then "yes" else "no"; + dpiAware = if config.module.dpi.aware then "yes" else "no"; fontStep = 1; in { file = (pkgs.formats.iniWithGlobalSection { }).generate "FootConfig" { diff --git a/home/config/fuzzel/default.nix b/home/config/fuzzel/default.nix index 24b70b56..18594ad2 100644 --- a/home/config/fuzzel/default.nix +++ b/home/config/fuzzel/default.nix @@ -3,7 +3,7 @@ config, ... }: let - dpiAware = if (config.module.dpi.aware or false) then "yes" else "no"; + dpiAware = if config.module.dpi.aware then "yes" else "no"; in { file = (pkgs.formats.ini { }).generate "FuzzelConfig" { main = { diff --git a/home/config/nvim/module/plugin/Gen.nix b/home/config/nvim/module/plugin/Gen.nix index e1103859..7d741eb7 100644 --- a/home/config/nvim/module/plugin/Gen.nix +++ b/home/config/nvim/module/plugin/Gen.nix @@ -4,7 +4,7 @@ }: { text = '' require("gen").setup { - model = "${config.module.ollama.primaryModel or ""}" + model = "${config.module.ollama.primaryModel}" } ''; } diff --git a/home/config/sway/default.nix b/home/config/sway/default.nix index a7d3864d..9e3d37fa 100644 --- a/home/config/sway/default.nix +++ b/home/config/sway/default.nix @@ -32,6 +32,6 @@ in { include /etc/sway/config.d/* '') + swayRc - + config.module.sway.extraConfig or "" + + config.module.sway.extraConfig ; } diff --git a/home/config/sway/module/Input.nix b/home/config/sway/module/Input.nix index 72db271e..3a048ce8 100644 --- a/home/config/sway/module/Input.nix +++ b/home/config/sway/module/Input.nix @@ -36,8 +36,8 @@ } input type:keyboard { - xkb_layout ${config.module.keyboard.layouts or ""} - xkb_options ${config.module.keyboard.options or ""} + xkb_layout ${config.module.keyboard.layouts} + xkb_options ${config.module.keyboard.options} } # Hide mouse cursor after a period of inactivity. diff --git a/home/config/waybar/config/default.nix b/home/config/waybar/config/default.nix index 39a11698..251c2eb5 100644 --- a/home/config/waybar/config/default.nix +++ b/home/config/waybar/config/default.nix @@ -146,8 +146,8 @@ in { temperature = { critical-threshold = 80; format = "{temperatureC}°C"; - hwmon-path-abs = "${config.module.hwmon.path or ""}"; - input-filename = "${config.module.hwmon.file or ""}"; + hwmon-path-abs = "${config.module.hwmon.path}"; + input-filename = "${config.module.hwmon.file}"; interval = refreshInterval; on-click = "foot -e bash -c btop"; on-click-right = "powersave toggle"; diff --git a/module/Dpi.nix b/module/Dpi.nix deleted file mode 100644 index f4d5a1c3..00000000 --- a/module/Dpi.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - config, - lib, - ... -}: let - cfg = config.module.dpi; -in { - options.module.dpi = { - aware = lib.mkOption { - default = false; - type = lib.types.bool; - }; - }; -} diff --git a/module/Style.nix b/module/Style.nix deleted file mode 100644 index a176a668..00000000 --- a/module/Style.nix +++ /dev/null @@ -1,115 +0,0 @@ -{ - __findFile, - config, - lib, - pkgs, - ... -}: let - cfg = config.module.style; - - mkTypeOption = default: type: lib.mkOption { inherit default type; }; - mkFloatOption = default: mkTypeOption default lib.types.float; - mkIntOption = default: mkTypeOption default lib.types.int; - mkPkgOption = default: mkTypeOption default lib.types.package; - mkStrOption = default: mkTypeOption default lib.types.str; -in { - options.module.style = { - color = { - accent = mkStrOption config.lib.stylix.colors.base0A; - heading = mkStrOption config.lib.stylix.colors.base0D; - hl = mkStrOption config.lib.stylix.colors.base03; - keyword = mkStrOption config.lib.stylix.colors.base0E; - link = mkStrOption config.lib.stylix.colors.base09; - misc = mkStrOption config.lib.stylix.colors.base0F; - negative = mkStrOption config.lib.stylix.colors.base08; - neutral = mkStrOption config.lib.stylix.colors.base0C; - positive = mkStrOption config.lib.stylix.colors.base0B; - selection = mkStrOption config.lib.stylix.colors.base02; - bg = { - dark = mkStrOption config.lib.stylix.colors.base00; - light = mkStrOption config.lib.stylix.colors.base07; - regular = mkStrOption config.lib.stylix.colors.base01; - }; - fg = { - dark = mkStrOption config.lib.stylix.colors.base04; - light = mkStrOption config.lib.stylix.colors.base06; - regular = mkStrOption config.lib.stylix.colors.base05; - }; - - accent-r = mkStrOption config.lib.stylix.colors.base0A-rgb-r; - accent-g = mkStrOption config.lib.stylix.colors.base0A-rgb-g; - accent-b = mkStrOption config.lib.stylix.colors.base0A-rgb-b; - - bg-r = mkStrOption config.lib.stylix.colors.base00-rgb-r; - bg-g = mkStrOption config.lib.stylix.colors.base00-rgb-g; - bg-b = mkStrOption config.lib.stylix.colors.base00-rgb-b; - - border = mkStrOption config.lib.stylix.colors.base01; - border-r = mkStrOption config.lib.stylix.colors.base01-rgb-r; - border-g = mkStrOption config.lib.stylix.colors.base01-rgb-g; - border-b = mkStrOption config.lib.stylix.colors.base01-rgb-b; - - fg-r = mkStrOption config.lib.stylix.colors.base06-rgb-r; - fg-g = mkStrOption config.lib.stylix.colors.base06-rgb-g; - fg-b = mkStrOption config.lib.stylix.colors.base06-rgb-b; - - negative-r = mkStrOption config.lib.stylix.colors.base08-rgb-r; - negative-g = mkStrOption config.lib.stylix.colors.base08-rgb-g; - negative-b = mkStrOption config.lib.stylix.colors.base08-rgb-b; - - neutral-r = mkStrOption config.lib.stylix.colors.base0C-rgb-r; - neutral-g = mkStrOption config.lib.stylix.colors.base0C-rgb-g; - neutral-b = mkStrOption config.lib.stylix.colors.base0C-rgb-b; - - positive-r = mkStrOption config.lib.stylix.colors.base0B-rgb-r; - positive-g = mkStrOption config.lib.stylix.colors.base0B-rgb-g; - positive-b = mkStrOption config.lib.stylix.colors.base0B-rgb-b; - - transparent = mkStrOption "ffffff00"; - }; - - cursor = { - name = mkStrOption "phinger-cursors-light"; - package = mkPkgOption pkgs.phinger-cursors; - size = mkIntOption 24; - }; - - font = { - emoji = { - name = mkStrOption "Noto Color Emoji"; - package = mkPkgOption pkgs.noto-fonts-emoji; - }; - monospace = { - name = mkStrOption "Terminess Nerd Font Mono"; - package = mkPkgOption (pkgs.nerdfonts.override { fonts = [ "Terminus" ]; }); - }; - sansSerif = { - name = mkStrOption "SF Pro Display"; - package = mkPkgOption (pkgs.callPackage { }); - }; - serif = { - name = mkStrOption "SF Pro Display"; - package = mkPkgOption (pkgs.callPackage { }); - }; - size = { - application = mkIntOption 12; - desktop = mkIntOption 14; - popup = mkIntOption 12; - terminal = mkIntOption 14; - }; - }; - - opacity = { - application = mkFloatOption 0.85; - desktop = mkFloatOption 0.85; - hex = mkStrOption "D9"; - popup = mkFloatOption 0.85; - terminal = mkFloatOption 0.85; - }; - - window = { - border = mkIntOption 4; - gap = mkIntOption 8; - }; - }; -} diff --git a/option/AmdCompute.nix b/option/AmdCompute.nix new file mode 100644 index 00000000..db5688b0 --- /dev/null +++ b/option/AmdCompute.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.amd.compute.enable = lib.mkEnableOption "the AMD Rocm support i.e. for Blender."; +} diff --git a/option/AmdCpu.nix b/option/AmdCpu.nix new file mode 100644 index 00000000..25e2ff6b --- /dev/null +++ b/option/AmdCpu.nix @@ -0,0 +1,9 @@ +{ + lib, + ... +}: { + options.module.amd.cpu = { + enable = lib.mkEnableOption "the AMD Cpu support."; + powersave = lib.mkEnableOption "the AMD Cpu powersave."; + }; +} diff --git a/option/AmdGpu.nix b/option/AmdGpu.nix new file mode 100644 index 00000000..c6259dfe --- /dev/null +++ b/option/AmdGpu.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.amd.gpu.enable = lib.mkEnableOption "the AMD Gpu support."; +} diff --git a/option/AutoUpdateSigned.nix b/option/AutoUpdateSigned.nix new file mode 100644 index 00000000..f95d3f7e --- /dev/null +++ b/option/AutoUpdateSigned.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.autoupdate.enable = lib.mkEnableOption "the system auto-updates."; +} diff --git a/option/Bluetooth.nix b/option/Bluetooth.nix new file mode 100644 index 00000000..17ff185b --- /dev/null +++ b/option/Bluetooth.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.bluetooth.enable = lib.mkEnableOption "the bluetooth support."; +} diff --git a/option/Brightness.nix b/option/Brightness.nix new file mode 100644 index 00000000..4b7a77ed --- /dev/null +++ b/option/Brightness.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.brightness.enable = lib.mkEnableOption "the brightness control."; +} diff --git a/option/DisplayManager.nix b/option/DisplayManager.nix new file mode 100644 index 00000000..cfa3f26b --- /dev/null +++ b/option/DisplayManager.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.dm.enable = lib.mkEnableOption "the display manager."; +} diff --git a/option/Distrobox.nix b/option/Distrobox.nix new file mode 100644 index 00000000..af6204a5 --- /dev/null +++ b/option/Distrobox.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.distrobox.enable = lib.mkEnableOption "the distrobox."; +} diff --git a/option/Docker.nix b/option/Docker.nix new file mode 100644 index 00000000..5be9fc0d --- /dev/null +++ b/option/Docker.nix @@ -0,0 +1,16 @@ +{ + lib, + ... +}: { + options.module.docker = { + enable = lib.mkEnableOption "the docker."; + rootless = lib.mkOption { + default = false; + type = lib.types.bool; + }; + autostart = lib.mkOption { + default = false; + type = lib.types.bool; + }; + }; +} diff --git a/option/Dpi.nix b/option/Dpi.nix new file mode 100644 index 00000000..37f50c5b --- /dev/null +++ b/option/Dpi.nix @@ -0,0 +1,10 @@ +# Screen density configuration. +{ + lib, + ... +}: { + options.module.dpi.aware = lib.mkOption { + default = false; + type = lib.types.bool; + }; +} diff --git a/option/Ftpd.nix b/option/Ftpd.nix new file mode 100644 index 00000000..591b31e5 --- /dev/null +++ b/option/Ftpd.nix @@ -0,0 +1,12 @@ +{ + lib, + ... +}: { + options.module.ftpd = { + enable = lib.mkEnableOption "the FTP server"; + storage = lib.mkOption { + default = null; + type = lib.types.str; + }; + }; +} diff --git a/option/Gnome.nix b/option/Gnome.nix new file mode 100644 index 00000000..8a0df255 --- /dev/null +++ b/option/Gnome.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.gnome.enable = lib.mkEnableOption "the Gnome DE."; +} diff --git a/module/Hwmon.nix b/option/Hwmon.nix similarity index 79% rename from module/Hwmon.nix rename to option/Hwmon.nix index 54ae0695..87332f88 100644 --- a/module/Hwmon.nix +++ b/option/Hwmon.nix @@ -1,10 +1,8 @@ +# Hardware monitor configuration. { - config, lib, ... -}: let - cfg = config.module.hwmon; -in { +}: { options.module.hwmon = { path = lib.mkOption { default = ""; diff --git a/option/IntelCpu.nix b/option/IntelCpu.nix new file mode 100644 index 00000000..b97b76d6 --- /dev/null +++ b/option/IntelCpu.nix @@ -0,0 +1,9 @@ +{ + lib, + ... +}: { + options.module.intel.cpu = { + enable = lib.mkEnableOption "the support for Intel CPUs."; + powersave = lib.mkEnableOption "the Intel CPU powersave."; + }; +} diff --git a/option/Kernel.nix b/option/Kernel.nix new file mode 100644 index 00000000..fd6733c1 --- /dev/null +++ b/option/Kernel.nix @@ -0,0 +1,20 @@ +{ + lib, + ... +}: { + options.module.kernel = { + enable = lib.mkEnableOption "the kernel tweaks."; + hardening = lib.mkOption { + default = false; + type = lib.types.bool; + }; + hotspotTtlBypass = lib.mkOption { + default = false; + type = lib.types.bool; + }; + latest = lib.mkOption { + default = false; + type = lib.types.bool; + }; + }; +} diff --git a/module/Keyboard.nix b/option/Keyboard.nix similarity index 80% rename from module/Keyboard.nix rename to option/Keyboard.nix index 2d3c88a3..db051fd2 100644 --- a/module/Keyboard.nix +++ b/option/Keyboard.nix @@ -1,10 +1,8 @@ +# Keyboard configuration. { - config, lib, ... -}: let - cfg = config.module.keyboard; -in { +}: { options.module.keyboard = { layouts = lib.mkOption { default = "us,ru"; diff --git a/option/Keyd.nix b/option/Keyd.nix new file mode 100644 index 00000000..fb5b569e --- /dev/null +++ b/option/Keyd.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.keyd.enable = lib.mkEnableOption "the keyboard remaps."; +} diff --git a/option/Ollama.nix b/option/Ollama.nix new file mode 100644 index 00000000..48c0665d --- /dev/null +++ b/option/Ollama.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + ... +}: let + cfg = config.module.ollama; +in { + options.module.ollama = { + enable = lib.mkEnableOption "the local LLM server."; + models = lib.mkOption { + default = [ cfg.primaryModel ]; + type = with lib.types; listOf str; + }; + primaryModel = lib.mkOption { + default = "llama3.2"; + type = lib.types.str; + }; + }; +} diff --git a/option/Package.nix b/option/Package.nix new file mode 100644 index 00000000..fd9dac89 --- /dev/null +++ b/option/Package.nix @@ -0,0 +1,14 @@ +{ + lib, + ... +}: { + options.module.package = { + common.enable = lib.mkEnableOption "Common Apps."; + core.enable = lib.mkEnableOption "Core apps."; + creative.enable = lib.mkEnableOption "Creative Apps."; + desktop.enable = lib.mkEnableOption "Desktop Apps."; + dev.enable = lib.mkEnableOption "Dev Apps."; + extra.enable = lib.mkEnableOption "Extra Apps."; + gaming.enable = lib.mkEnableOption "Gaming Apps."; + }; +} diff --git a/option/Podman.nix b/option/Podman.nix new file mode 100644 index 00000000..cc49a3cf --- /dev/null +++ b/option/Podman.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.podman.enable = lib.mkEnableOption "the OCI Podman."; +} diff --git a/option/Polkit.nix b/option/Polkit.nix new file mode 100644 index 00000000..66dcec81 --- /dev/null +++ b/option/Polkit.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.polkit.enable = lib.mkEnableOption "the polkit."; +} diff --git a/option/Portal.nix b/option/Portal.nix new file mode 100644 index 00000000..b8e31b0a --- /dev/null +++ b/option/Portal.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.portal.enable = lib.mkEnableOption "the portals."; +} diff --git a/option/PowerlimitThinkpad.nix b/option/PowerlimitThinkpad.nix new file mode 100644 index 00000000..617cc58a --- /dev/null +++ b/option/PowerlimitThinkpad.nix @@ -0,0 +1,24 @@ +{ + lib, + ... +}: { + options.module.powerlimit.thinkpad = { + enable = lib.mkEnableOption "the powerlimit service"; + onMin = lib.mkOption { + default = 40; + type = lib.types.int; + }; + onMax = lib.mkOption { + default = 80; + type = lib.types.int; + }; + offMin = lib.mkOption { + default = 90; + type = lib.types.int; + }; + offMax = lib.mkOption { + default = 95; + type = lib.types.int; + }; + }; +} diff --git a/option/Powersave.nix b/option/Powersave.nix new file mode 100644 index 00000000..d8e451ed --- /dev/null +++ b/option/Powersave.nix @@ -0,0 +1,22 @@ +{ + lib, + ... +}: { + options.module.powersave = { + enable = lib.mkEnableOption "the powersave"; + cpu.boost = { + disableCmd = lib.mkOption { + default = null; + type = lib.types.str; + }; + enableCmd = lib.mkOption { + default = null; + type = lib.types.str; + }; + controlFile = lib.mkOption { + default = null; + type = lib.types.str; + }; + }; + }; +} diff --git a/option/Print.nix b/option/Print.nix new file mode 100644 index 00000000..5ae96544 --- /dev/null +++ b/option/Print.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.print.enable = lib.mkEnableOption "the support for printers."; +} diff --git a/option/Realtime.nix b/option/Realtime.nix new file mode 100644 index 00000000..c78972b3 --- /dev/null +++ b/option/Realtime.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.realtime.enable = lib.mkEnableOption "the realtime access."; +} diff --git a/option/RemoteBuild.nix b/option/RemoteBuild.nix new file mode 100644 index 00000000..05f25912 --- /dev/null +++ b/option/RemoteBuild.nix @@ -0,0 +1,9 @@ +{ + lib, + ... +}: { + options.module.builder = { + server.enable = lib.mkEnableOption "the builder server."; + client.enable = lib.mkEnableOption "the builder client."; + }; +} diff --git a/option/Sound.nix b/option/Sound.nix new file mode 100644 index 00000000..efd71ce1 --- /dev/null +++ b/option/Sound.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.sound.enable = lib.mkEnableOption "the sound."; +} diff --git a/option/Style.nix b/option/Style.nix new file mode 100644 index 00000000..d1edaf01 --- /dev/null +++ b/option/Style.nix @@ -0,0 +1,117 @@ +# Styling like colors, fonts, cursor etc. +{ + __findFile, + config, + lib, + pkgs, + ... +}: let + cfg = config.module.style; + stylix = config.lib.stylix or config.home-manager.config.lib.stylix; + + mkTypeOption = default: type: lib.mkOption { inherit default type; }; + mkFloatOption = default: mkTypeOption default lib.types.float; + mkIntOption = default: mkTypeOption default lib.types.int; + mkPkgOption = default: mkTypeOption default lib.types.package; + mkStrOption = default: mkTypeOption default lib.types.str; +in { + options.module.style = { + color = { + accent = mkStrOption stylix.colors.base0A; + heading = mkStrOption stylix.colors.base0D; + hl = mkStrOption stylix.colors.base03; + keyword = mkStrOption stylix.colors.base0E; + link = mkStrOption stylix.colors.base09; + misc = mkStrOption stylix.colors.base0F; + negative = mkStrOption stylix.colors.base08; + neutral = mkStrOption stylix.colors.base0C; + positive = mkStrOption stylix.colors.base0B; + selection = mkStrOption stylix.colors.base02; + bg = { + dark = mkStrOption stylix.colors.base00; + light = mkStrOption stylix.colors.base07; + regular = mkStrOption stylix.colors.base01; + }; + fg = { + dark = mkStrOption stylix.colors.base04; + light = mkStrOption stylix.colors.base06; + regular = mkStrOption stylix.colors.base05; + }; + + accent-r = mkStrOption stylix.colors.base0A-rgb-r; + accent-g = mkStrOption stylix.colors.base0A-rgb-g; + accent-b = mkStrOption stylix.colors.base0A-rgb-b; + + bg-r = mkStrOption stylix.colors.base00-rgb-r; + bg-g = mkStrOption stylix.colors.base00-rgb-g; + bg-b = mkStrOption stylix.colors.base00-rgb-b; + + border = mkStrOption stylix.colors.base01; + border-r = mkStrOption stylix.colors.base01-rgb-r; + border-g = mkStrOption stylix.colors.base01-rgb-g; + border-b = mkStrOption stylix.colors.base01-rgb-b; + + fg-r = mkStrOption stylix.colors.base06-rgb-r; + fg-g = mkStrOption stylix.colors.base06-rgb-g; + fg-b = mkStrOption stylix.colors.base06-rgb-b; + + negative-r = mkStrOption stylix.colors.base08-rgb-r; + negative-g = mkStrOption stylix.colors.base08-rgb-g; + negative-b = mkStrOption stylix.colors.base08-rgb-b; + + neutral-r = mkStrOption stylix.colors.base0C-rgb-r; + neutral-g = mkStrOption stylix.colors.base0C-rgb-g; + neutral-b = mkStrOption stylix.colors.base0C-rgb-b; + + positive-r = mkStrOption stylix.colors.base0B-rgb-r; + positive-g = mkStrOption stylix.colors.base0B-rgb-g; + positive-b = mkStrOption stylix.colors.base0B-rgb-b; + + transparent = mkStrOption "ffffff00"; + }; + + cursor = { + name = mkStrOption "phinger-cursors-light"; + package = mkPkgOption pkgs.phinger-cursors; + size = mkIntOption 24; + }; + + font = { + emoji = { + name = mkStrOption "Noto Color Emoji"; + package = mkPkgOption pkgs.noto-fonts-emoji; + }; + monospace = { + name = mkStrOption "Terminess Nerd Font Mono"; + package = mkPkgOption (pkgs.nerdfonts.override { fonts = [ "Terminus" ]; }); + }; + sansSerif = { + name = mkStrOption "SF Pro Display"; + package = mkPkgOption (pkgs.callPackage { }); + }; + serif = { + name = mkStrOption "SF Pro Display"; + package = mkPkgOption (pkgs.callPackage { }); + }; + size = { + application = mkIntOption 12; + desktop = mkIntOption 14; + popup = mkIntOption 12; + terminal = mkIntOption 14; + }; + }; + + opacity = { + application = mkFloatOption 0.85; + desktop = mkFloatOption 0.85; + hex = mkStrOption "D9"; + popup = mkFloatOption 0.85; + terminal = mkFloatOption 0.85; + }; + + window = { + border = mkIntOption 4; + gap = mkIntOption 8; + }; + }; +} diff --git a/option/Sway.nix b/option/Sway.nix new file mode 100644 index 00000000..df714b8d --- /dev/null +++ b/option/Sway.nix @@ -0,0 +1,12 @@ +{ + lib, + ... +}: { + options.module.sway = { + enable = lib.mkEnableOption "the Sway WM."; + extraConfig = lib.mkOption { + default = ""; + type = lib.types.str; + }; + }; +} diff --git a/option/Tablet.nix b/option/Tablet.nix new file mode 100644 index 00000000..cd52d8e1 --- /dev/null +++ b/option/Tablet.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.tablet.enable = lib.mkEnableOption "the support for tables."; +} diff --git a/option/VirtManager.nix b/option/VirtManager.nix new file mode 100644 index 00000000..c02a5dd4 --- /dev/null +++ b/option/VirtManager.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.virtmanager.enable = lib.mkEnableOption "the VM support."; +} diff --git a/module/Wallpaper.nix b/option/Wallpaper.nix similarity index 93% rename from module/Wallpaper.nix rename to option/Wallpaper.nix index c87716ed..aacf40f5 100644 --- a/module/Wallpaper.nix +++ b/option/Wallpaper.nix @@ -1,3 +1,4 @@ +# Download the wallpaper here. { pkgs, lib, diff --git a/option/Waybar.nix b/option/Waybar.nix new file mode 100644 index 00000000..5441c3b6 --- /dev/null +++ b/option/Waybar.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.waybar.enable = lib.mkEnableOption "the Waybar."; +} diff --git a/option/Wayland.nix b/option/Wayland.nix new file mode 100644 index 00000000..01a96a59 --- /dev/null +++ b/option/Wayland.nix @@ -0,0 +1,6 @@ +{ + lib, + ... +}: { + options.module.wayland.enable = lib.mkEnableOption "the wayland."; +}