diff --git a/config.nix b/config.nix index 5f6688d..6c87c1d 100644 --- a/config.nix +++ b/config.nix @@ -63,5 +63,10 @@ lib: { "SUPER, slash, exec, $passwordManager" ]; }; + exclude_packages = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = []; + description = "Packages to exclude from the default system packages"; + }; }; } diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 7e910e6..c4e6a13 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,9 +1,10 @@ inputs: { config, pkgs, + lib, ... }: let - packages = import ../packages.nix {inherit pkgs;}; + packages = import ../packages.nix {inherit pkgs lib; exclude_packages = config.omarchy.exclude_packages;}; themes = import ../themes.nix; selectedTheme = themes.${config.omarchy.theme}; diff --git a/modules/nixos/system.nix b/modules/nixos/system.nix index 08f5bfa..09b0cd0 100644 --- a/modules/nixos/system.nix +++ b/modules/nixos/system.nix @@ -1,10 +1,11 @@ { config, pkgs, + lib, ... }: let cfg = config.omarchy; - packages = import ../packages.nix {inherit pkgs;}; + packages = import ../packages.nix {inherit pkgs lib; exclude_packages = cfg.exclude_packages;}; in { security.rtkit.enable = true; services.pulseaudio.enable = false; diff --git a/modules/packages.nix b/modules/packages.nix index d90af3c..5f11657 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -1,26 +1,27 @@ -{pkgs}: { - # Regular packages - systemPackages = with pkgs; [ - # Base system tools - git - vim - libnotify - pavucontrol - brightnessctl - ffmpeg - nautilus +{pkgs, lib, exclude_packages ? []}: +let + # Essential Hyprland packages - cannot be excluded + hyprlandPackages = with pkgs; [ hyprshot hyprpicker hyprsunset - alejandra + brightnessctl pamixer playerctl bibata-cursors gnome-themes-extra + pavucontrol + ]; + + # Essential system packages - cannot be excluded + systemPackages = with pkgs; [ + git + vim + libnotify + nautilus + alejandra blueberry clipse - - # Shell tools fzf zoxide ripgrep @@ -30,7 +31,10 @@ unzip wget gnumake + ]; + # Discretionary packages - can be excluded by user + discretionaryPackages = with pkgs; [ # TUIs lazygit lazydocker @@ -42,23 +46,12 @@ chromium obsidian vlc - - # Can't find this in nixpkgs! - # Might have to make it ourselves - # asdcontrol - - # Don't want these right now - # obs-studio - # kdePackages.kdenLive - # pinta - # libreoffice signal-desktop # Commercial GUIs typora dropbox spotify - # zoom # Development tools github-desktop @@ -66,9 +59,16 @@ # Containers docker-compose - # podman-compose + ffmpeg ]; + # Only allow excluding discretionary packages to prevent breaking the system + filteredDiscretionaryPackages = lib.lists.subtractLists exclude_packages discretionaryPackages; + allSystemPackages = hyprlandPackages ++ systemPackages ++ filteredDiscretionaryPackages; +in { + # Regular packages + systemPackages = allSystemPackages; + homePackages = with pkgs; [ ]; }