From 0841242b94638fcd010f7f64e56b7b1cad50c697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Wed, 19 Jul 2023 18:18:40 +0200 Subject: [PATCH] ripgrep: don't set env. variable if no config (#4254) Fixes https://github.com/nix-community/home-manager/issues/4253 --- modules/programs/ripgrep.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/programs/ripgrep.nix b/modules/programs/ripgrep.nix index 39b318243..cbd73bd15 100644 --- a/modules/programs/ripgrep.nix +++ b/modules/programs/ripgrep.nix @@ -30,13 +30,13 @@ in { }; config = mkIf cfg.enable { - home = { - packages = [ cfg.package ]; + home = mkMerge [ + { packages = [ cfg.package ]; } + (mkIf (cfg.arguments != [ ]) { + file."${configPath}".text = lib.concatLines cfg.arguments; - file."${configPath}" = - mkIf (cfg.arguments != [ ]) { text = lib.concatLines cfg.arguments; }; - - sessionVariables = { "RIPGREP_CONFIG_PATH" = configPath; }; - }; + sessionVariables."RIPGREP_CONFIG_PATH" = configPath; + }) + ]; }; }