mirror of
https://github.com/nix-community/home-manager
synced 2025-01-30 21:05:02 +01:00
mise: enable nushell integration
This commit is contained in:
parent
cefb1889b9
commit
b319f19591
3 changed files with 37 additions and 0 deletions
|
@ -21,6 +21,7 @@ in {
|
||||||
"enableBashIntegration"
|
"enableBashIntegration"
|
||||||
"enableZshIntegration"
|
"enableZshIntegration"
|
||||||
"enableFishIntegration"
|
"enableFishIntegration"
|
||||||
|
"enableNushellIntegration"
|
||||||
"settings"
|
"settings"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -42,6 +43,10 @@ in {
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableNushellIntegration = mkEnableOption "Nushell Integration" // {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
globalConfig = mkOption {
|
globalConfig = mkOption {
|
||||||
type = tomlFormat.type;
|
type = tomlFormat.type;
|
||||||
default = { };
|
default = { };
|
||||||
|
@ -106,6 +111,16 @@ in {
|
||||||
fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
|
fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
|
||||||
${getExe cfg.package} activate fish | source
|
${getExe cfg.package} activate fish | source
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
nushell = mkIf cfg.enableNushellIntegration {
|
||||||
|
extraEnv = ''
|
||||||
|
let mise_path = $nu.default-config-dir | path join mise.nu
|
||||||
|
^mise activate nu | save $mise_path --force
|
||||||
|
'';
|
||||||
|
extraConfig = ''
|
||||||
|
use ($nu.default-config-dir | path join mise.nu)
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,4 +4,5 @@
|
||||||
mise-bash-integration = ./bash-integration.nix;
|
mise-bash-integration = ./bash-integration.nix;
|
||||||
mise-zsh-integration = ./zsh-integration.nix;
|
mise-zsh-integration = ./zsh-integration.nix;
|
||||||
mise-fish-integration = ./fish-integration.nix;
|
mise-fish-integration = ./fish-integration.nix;
|
||||||
|
mise-nushell-integration = ./nushell-integration.nix;
|
||||||
}
|
}
|
||||||
|
|
21
tests/modules/programs/mise/nushell-integration.nix
Normal file
21
tests/modules/programs/mise/nushell-integration.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ config, ... }: {
|
||||||
|
programs = {
|
||||||
|
mise = {
|
||||||
|
package = config.lib.test.mkStubPackage { name = "mise"; };
|
||||||
|
enable = true;
|
||||||
|
enableNushellIntegration = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nushell.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileContains home-files/.config/nushell/env.nu \
|
||||||
|
'
|
||||||
|
let mise_path = $nu.default-config-dir | path join mise.nu
|
||||||
|
^mise activate nu | save $mise_path --force
|
||||||
|
'
|
||||||
|
assertFileContains home-files/.config/nushell/config.nu \
|
||||||
|
'use ($nu.default-config-dir | path join mise.nu)'
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue