Skip to content

Commit

Permalink
fix: only eval enable option if visible
Browse files Browse the repository at this point in the history
Fixes #211
  • Loading branch information
zimbatm committed Aug 10, 2024
1 parent 768acdb commit 057ece7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions module-options.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ config
, options
, lib
, pkgs
, ...
Expand Down Expand Up @@ -197,11 +198,14 @@ in
package used to do the formatting.
'';
defaultText = lib.literalMD "Programs used in configuration";
default = pkgs.lib.concatMapAttrs
(
k: v: if v.enable then { "${k}" = v.package; } else { }
)
config.programs;
default =
pkgs.lib.concatMapAttrs
(
k: v:
if options.programs.${k}.enable.visible && v.enable then
{ "${k}" = v.package; } else { }
)
config.programs;
};
check = mkOption {
description = ''
Expand Down

0 comments on commit 057ece7

Please sign in to comment.