1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 15:09:46 +01:00

direnv: add xonsh support

This commit is contained in:
paki23 2024-06-03 22:21:33 +02:00
parent 3b8c935aa1
commit 3e1b8d8251
No known key found for this signature in database
GPG key ID: 13160FFB4CEB03F2

View file

@ -64,6 +64,14 @@ in {
''; '';
}; };
enableXonshIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Xonsh integration.
'';
};
enableFishIntegration = mkOption { enableFishIntegration = mkOption {
default = true; default = true;
type = types.bool; type = types.bool;
@ -130,6 +138,27 @@ in {
${getExe cfg.package} hook fish | source ${getExe cfg.package} hook fish | source
''); '');
programs.xonsh = mkIf cfg.enableXonshIntegration {
xonshrc = "xontrib load direnv";
extraPackages = ps:
[
(ps.buildPythonPackage {
name = "xonsh-direnv";
src = pkgs.fetchFromGitHub {
owner = "74th";
repo = "xonsh-direnv";
rev = "fd086e737a2d54495619a40d2a0f9e96475626e7";
hash = "sha256-6/V7ZYMOB3E7TO7y8emC5lfdgeYxmfc/yLnEhjrWQ54=";
};
postPatch = ''
substituteInPlace xontrib/direnv.xsh --replace '$(direnv' '$(${
getExe cfg.package
}'
'';
})
];
};
programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration ( programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration (
# Using mkAfter to make it more likely to appear after other # Using mkAfter to make it more likely to appear after other
# manipulations of the prompt. # manipulations of the prompt.