0
0
Fork 0
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:
h7x4 2025-03-12 18:53:07 +01:00 committed by GitHub
commit ce52fcd4eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 = {