From d53093a6c17ce363be0722e1a1be5a7f89295ef6 Mon Sep 17 00:00:00 2001 From: mjallen18 Date: Wed, 18 Mar 2026 21:05:20 -0500 Subject: [PATCH] cleanup --- modules/darwin/nix/default.nix | 5 +- modules/home/programs/common/default-apps.nix | 46 +++++++++++++++++++ modules/home/programs/hyprland/options.nix | 45 +----------------- modules/home/programs/nwg-panel/options.nix | 43 ++--------------- modules/home/sops/options.nix | 3 +- 5 files changed, 55 insertions(+), 87 deletions(-) create mode 100644 modules/home/programs/common/default-apps.nix diff --git a/modules/darwin/nix/default.nix b/modules/darwin/nix/default.nix index d38c5fb..98e44e0 100644 --- a/modules/darwin/nix/default.nix +++ b/modules/darwin/nix/default.nix @@ -50,8 +50,9 @@ nixpkgs = { config = { - cudaSupport = lib.mkDefault config.${namespace}.hardware.nvidia.enable; - rocmSupport = lib.mkDefault config.${namespace}.hardware.amd.enable; + # CUDA and ROCm are not applicable on Darwin; those hardware modules are + # NixOS-only. Unfree allowance is handled globally via channels-config in + # the flake. allowUnsupportedSystem = true; }; }; diff --git a/modules/home/programs/common/default-apps.nix b/modules/home/programs/common/default-apps.nix new file mode 100644 index 0000000..3b4df9e --- /dev/null +++ b/modules/home/programs/common/default-apps.nix @@ -0,0 +1,46 @@ +# Shared defaultApps submodule options, used by both the hyprland and +# nwg-panel modules. Import this file and pass the result as the `options` +# argument to types.submodule to avoid duplicating the definition. +{ pkgs, lib, ... }: +{ + browser = lib.mkOption { + type = lib.types.package; + default = pkgs.firefox; + description = "Default web browser"; + }; + editor = lib.mkOption { + type = lib.types.package; + default = pkgs.micro; + description = "Default text editor"; + }; + fileExplorer = lib.mkOption { + type = lib.types.package; + default = pkgs.nautilus; + description = "Default file explorer"; + }; + visual = lib.mkOption { + type = lib.types.package; + default = pkgs.vscodium; + description = "Default visual/IDE editor"; + }; + terminal = lib.mkOption { + type = lib.types.package; + default = pkgs.kitty; + description = "Default terminal emulator"; + }; + office = lib.mkOption { + type = lib.types.package; + default = pkgs.onlyoffice-desktopeditors; + description = "Default office suite"; + }; + video = lib.mkOption { + type = lib.types.package; + default = pkgs.vlc; + description = "Default video player"; + }; + imageViewer = lib.mkOption { + type = lib.types.package; + default = pkgs.nomacs; + description = "Default image viewer"; + }; +} diff --git a/modules/home/programs/hyprland/options.nix b/modules/home/programs/hyprland/options.nix index 7eec3de..15b0908 100644 --- a/modules/home/programs/hyprland/options.nix +++ b/modules/home/programs/hyprland/options.nix @@ -158,50 +158,7 @@ with lib; }; defaultApps = mkOption { - type = types.submodule { - options = { - browser = mkOption { - type = types.package; - default = pkgs.firefox; - description = "Default browser"; - }; - editor = mkOption { - type = types.package; - default = pkgs.micro; - description = "Default text editor"; - }; - fileExplorer = mkOption { - type = types.package; - default = pkgs.nautilus; - description = "Default file explorer"; - }; - visual = mkOption { - type = types.package; - default = pkgs.vscodium; - description = "Default visual editor"; - }; - terminal = mkOption { - type = types.package; - default = pkgs.kitty; - description = "Default terminal"; - }; - office = mkOption { - type = types.package; - default = pkgs.onlyoffice-desktopeditors; - description = "Default office suite"; - }; - video = mkOption { - type = types.package; - default = pkgs.vlc; - description = "Default video player"; - }; - imageViewer = mkOption { - type = types.package; - default = pkgs.nomacs; - description = "Default image viewer"; - }; - }; - }; + type = types.submodule (import ../common/default-apps.nix); description = "Default applications used across the system"; }; diff --git a/modules/home/programs/nwg-panel/options.nix b/modules/home/programs/nwg-panel/options.nix index ff718ef..75ae10a 100644 --- a/modules/home/programs/nwg-panel/options.nix +++ b/modules/home/programs/nwg-panel/options.nix @@ -1,51 +1,14 @@ { lib, - pkgs, namespace, ... }: -with lib; { options.${namespace}.programs.nwg-panel = { - enable = mkEnableOption "enable nwg-panel"; + enable = lib.mkEnableOption "nwg-panel"; - defaultApps = mkOption { - type = types.submodule { - options = { - browser = mkOption { - type = types.package; - default = pkgs.firefox; - }; - editor = mkOption { - type = types.package; - default = pkgs.micro; - }; - fileExplorer = mkOption { - type = types.package; - default = pkgs.nautilus; - }; - visual = mkOption { - type = types.package; - default = pkgs.vscodium; - }; - terminal = mkOption { - type = types.package; - default = pkgs.kitty; - }; - office = mkOption { - type = types.package; - default = pkgs.onlyoffice-desktopeditors; - }; - video = mkOption { - type = types.package; - default = pkgs.vlc; - }; - imageViewer = mkOption { - type = types.package; - default = pkgs.gnome-photos; - }; - }; - }; + defaultApps = lib.mkOption { + type = lib.types.submodule (import ../common/default-apps.nix); description = "Default applications used across the system."; }; }; diff --git a/modules/home/sops/options.nix b/modules/home/sops/options.nix index c2d8773..b8efc65 100644 --- a/modules/home/sops/options.nix +++ b/modules/home/sops/options.nix @@ -5,8 +5,9 @@ with lib; enable = mkEnableOption "enable sops"; defaultSopsFile = mkOption { - type = types.str; + type = types.nullOr types.path; default = null; + description = "Path to the default sops secrets file."; }; }; }