mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos/direnv: add xonsh integration (#383435)
This commit is contained in:
commit
ce52fcd4eb
1 changed files with 16 additions and 0 deletions
|
@ -34,6 +34,9 @@ in
|
|||
enableFishIntegration = enabledOption ''
|
||||
Fish integration
|
||||
'';
|
||||
enableXonshIntegration = enabledOption ''
|
||||
Xonsh integration
|
||||
'';
|
||||
|
||||
direnvrcExtra = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
|
@ -94,6 +97,19 @@ in
|
|||
${lib.getExe cfg.package} hook fish | source
|
||||
end
|
||||
'';
|
||||
|
||||
xonsh = lib.mkIf cfg.enableXonshIntegration {
|
||||
extraPackages = ps: [ ps.xonsh.xontribs.xonsh-direnv ];
|
||||
config = ''
|
||||
if ${
|
||||
if cfg.loadInNixShell then
|
||||
"True"
|
||||
else
|
||||
"not any(map(lambda s: s.startswith('/nix/store'), __xonsh__.env.get('PATH')))"
|
||||
}:
|
||||
xontrib load direnv
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
environment = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue