diff --git a/home-manager/sajenim/features/desktop/default.nix b/home-manager/sajenim/features/desktop/default.nix index 3ae2fe0..32b868f 100644 --- a/home-manager/sajenim/features/desktop/default.nix +++ b/home-manager/sajenim/features/desktop/default.nix @@ -5,6 +5,7 @@ }: { imports = [ ./cava + ./discord ./dunst ./mpv ./obs diff --git a/home-manager/sajenim/features/desktop/discord/default.nix b/home-manager/sajenim/features/desktop/discord/default.nix new file mode 100644 index 0000000..4d0609b --- /dev/null +++ b/home-manager/sajenim/features/desktop/discord/default.nix @@ -0,0 +1,15 @@ +{ + pkgs, + ... +}: { + nixpkgs.overlays = [ + (final: prev: { + discord = prev.discord.override {withOpenASAR = true;}; + }) + ]; + + home.packages = with pkgs; [ + discord + betterdiscordctl + ]; +} diff --git a/home-manager/sajenim/features/editors/default.nix b/home-manager/sajenim/features/editors/default.nix index 6b9444f..6aa286d 100644 --- a/home-manager/sajenim/features/editors/default.nix +++ b/home-manager/sajenim/features/editors/default.nix @@ -37,14 +37,6 @@ ]) ]); # https://github.com/theCapypara/nix-jetbrains-plugins - # Allow unfree packages for proprietary software - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - "claude-code" - "idea-ultimate" - "idea-ultimate-with-plugins" - ]; - # Copy our configuration files to home directory home.file = { ".ideavimrc".source = ./ideavimrc; diff --git a/home-manager/sajenim/global/default.nix b/home-manager/sajenim/global/default.nix index 02bc257..6d376e5 100644 --- a/home-manager/sajenim/global/default.nix +++ b/home-manager/sajenim/global/default.nix @@ -1,4 +1,4 @@ -{outputs, ...}: { +{outputs, lib, ...}: { imports = [ ./zsh.nix ]; @@ -11,6 +11,19 @@ ]; config = { allowUnfree = false; + # Centralized unfree package allowlist. + # Note: nixpkgs.config.allowUnfreePredicate doesn't merge across modules - only the + # last definition wins. To maintain explicit control over unfree packages, we list + # all allowed packages here rather than scattering predicates across feature modules. + allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + # Editors + "claude-code" + "idea-ultimate" + "idea-ultimate-with-plugins" + # Desktop + "discord" + ]; }; }; diff --git a/nixos/common/global/default.nix b/nixos/common/global/default.nix index 23a2753..f49fb35 100644 --- a/nixos/common/global/default.nix +++ b/nixos/common/global/default.nix @@ -1,4 +1,4 @@ -{outputs, ...}: { +{outputs, lib, ...}: { imports = [ ./age.nix ./env.nix @@ -15,6 +15,18 @@ ]; config = { allowUnfree = false; + # Centralized unfree package allowlist for NixOS system configuration. + # Note: nixpkgs.config.allowUnfreePredicate doesn't merge across modules - only the + # last definition wins. To maintain explicit control over unfree packages, we list + # all allowed packages here rather than scattering predicates across system modules. + allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + # Gaming + "steam" + "steam-unwrapped" + # Services + "minecraft-server" + ]; }; }; diff --git a/nixos/common/users/sajenim/steam/default.nix b/nixos/common/users/sajenim/steam/default.nix index 08d95cd..8cd88a2 100644 --- a/nixos/common/users/sajenim/steam/default.nix +++ b/nixos/common/users/sajenim/steam/default.nix @@ -27,10 +27,4 @@ "d /home/sajenim/.local 0755 sajenim users -" "d /home/sajenim/.local/share 0755 sajenim users -" ]; - - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - "steam" - "steam-unwrapped" - ]; } diff --git a/nixos/viridian/services/minecraft/default.nix b/nixos/viridian/services/minecraft/default.nix index 2f6af92..86744d1 100644 --- a/nixos/viridian/services/minecraft/default.nix +++ b/nixos/viridian/services/minecraft/default.nix @@ -116,9 +116,4 @@ in { } ]; }; - - # Allow unfree packages. - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "minecraft-server" - ]; }