From 68d3cdd722c86b737cc45d9961ef94baa1299168 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sun, 7 Oct 2018 09:53:40 -0500 Subject: [PATCH] direnv: add stdlib option --- modules/programs/direnv.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index e1654309..4707c6ce 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -14,6 +14,14 @@ in options.programs.direnv = { enable = mkEnableOption "direnv, the environment switcher"; + stdlib = mkOption { + type = types.lines; + default = ""; + description = '' + Custom stdlib written to ~/.config/direnv/direnvrc. + ''; + }; + enableBashIntegration = mkOption { default = true; type = types.bool; @@ -42,6 +50,10 @@ in config = mkIf cfg.enable { home.packages = [ pkgs.direnv ]; + xdg.configFile."direnv/direnvrc" = mkIf (cfg.stdlib != "") { + text = cfg.stdlib; + }; + programs.bash.initExtra = mkIf cfg.enableBashIntegration ( # Using mkAfter to make it more likely to appear after other