mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
direnv: add xonsh support
This commit is contained in:
parent
3b8c935aa1
commit
3e1b8d8251
1 changed files with 29 additions and 0 deletions
|
@ -64,6 +64,14 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
enableXonshIntegration = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Whether to enable Xonsh integration.
|
||||
'';
|
||||
};
|
||||
|
||||
enableFishIntegration = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
|
@ -130,6 +138,27 @@ in {
|
|||
${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 (
|
||||
# Using mkAfter to make it more likely to appear after other
|
||||
# manipulations of the prompt.
|
||||
|
|
Loading…
Reference in a new issue