1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-06 16:57:03 +00:00

mise: enable nushell integration (#6363)

This commit is contained in:
ljyoth 2025-02-17 20:36:02 -05:00 committed by GitHub
parent 6c93eea85d
commit 69dfc316c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 0 deletions

View file

@ -21,6 +21,7 @@ in {
"enableBashIntegration"
"enableZshIntegration"
"enableFishIntegration"
"enableNushellIntegration"
"settings"
];
@ -39,6 +40,9 @@ in {
enableZshIntegration =
lib.hm.shell.mkZshIntegrationOption { inherit config; };
enableNushellIntegration =
lib.hm.shell.mkNushellIntegrationOption { inherit config; };
globalConfig = mkOption {
type = tomlFormat.type;
default = { };
@ -103,6 +107,16 @@ in {
fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
${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)
'';
};
};
};
}

View file

@ -4,4 +4,5 @@
mise-bash-integration = ./bash-integration.nix;
mise-zsh-integration = ./zsh-integration.nix;
mise-fish-integration = ./fish-integration.nix;
mise-nushell-integration = ./nushell-integration.nix;
}

View 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)'
'';
}