Skip to content

Commit

Permalink
nixvim: simplify condition
Browse files Browse the repository at this point in the history
Checking `config.programs ? nixvim` **and** `options.programs ? nixvim`
is redundant.

Also, checking in the `mkIf` will not avoid missing option errors, only
`optionalAttrs` is useful for that.
  • Loading branch information
MattSturgeon committed Jun 5, 2024
1 parent b7bde26 commit 7098394
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/nixvim/nixvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
};

config = {
programs = lib.mkIf ((config.programs ? nixvim) && config.stylix.targets.nixvim.enable) (
lib.optionalAttrs (builtins.hasAttr "nixvim" options.programs) {
programs = lib.mkIf config.stylix.targets.nixvim.enable (
lib.optionalAttrs (config.programs ? nixvim) {
nixvim = config.stylix.targets.nixvim.config;
}
);
Expand Down

0 comments on commit 7098394

Please sign in to comment.