mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
nixos/direnv: add xonsh integration
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user