mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
direnv: add stdlib option
This commit is contained in:
parent
5770dc58b9
commit
68d3cdd722
1 changed files with 12 additions and 0 deletions
|
@ -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 <filename>~/.config/direnv/direnvrc</filename>.
|
||||
'';
|
||||
};
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue