mise: add module
This adds the support for the mise program, the successor of rtx. This commit therefore also removes the rtx module.
This commit is contained in:
parent
9b378afae7
commit
928f2528f9
16 changed files with 222 additions and 170 deletions
16
tests/modules/programs/mise/bash-integration.nix
Normal file
16
tests/modules/programs/mise/bash-integration.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ config, ... }: {
|
||||
programs = {
|
||||
mise = {
|
||||
package = config.lib.test.mkStubPackage { name = "mise"; };
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
};
|
||||
|
||||
bash.enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileRegex home-files/.bashrc 'eval "$(/nix/store/.*mise.*/bin/mise activate bash)"'
|
||||
'';
|
||||
}
|
||||
|
||||
45
tests/modules/programs/mise/custom-settings.nix
Normal file
45
tests/modules/programs/mise/custom-settings.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ config, pkgs, ... }: {
|
||||
programs = {
|
||||
mise = {
|
||||
package = config.lib.test.mkStubPackage { name = "mise"; };
|
||||
enable = true;
|
||||
globalConfig = {
|
||||
tools = {
|
||||
node = "lts";
|
||||
python = [ "3.10" "3.11" ];
|
||||
};
|
||||
|
||||
aliases = { my_custom_node = "20"; };
|
||||
};
|
||||
settings = {
|
||||
verbose = false;
|
||||
experimental = true;
|
||||
disable_tools = [ "node" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/mise/config.toml
|
||||
assertPathExists home-files/.config/mise/settings.toml
|
||||
|
||||
assertFileContent home-files/.config/mise/config.toml ${
|
||||
pkgs.writeText "mise.config.expected" ''
|
||||
[aliases]
|
||||
my_custom_node = "20"
|
||||
|
||||
[tools]
|
||||
node = "lts"
|
||||
python = ["3.10", "3.11"]
|
||||
''
|
||||
}
|
||||
|
||||
assertFileContent home-files/.config/mise/settings.toml ${
|
||||
pkgs.writeText "mise.settings.expected" ''
|
||||
disable_tools = ["node"]
|
||||
experimental = true
|
||||
verbose = false
|
||||
''
|
||||
}
|
||||
'';
|
||||
}
|
||||
13
tests/modules/programs/mise/default-settings.nix
Normal file
13
tests/modules/programs/mise/default-settings.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, ... }: {
|
||||
config = {
|
||||
programs.mise = {
|
||||
package = config.lib.test.mkStubPackage { name = "mise"; };
|
||||
enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/mise/config.toml
|
||||
assertPathNotExists home-files/.config/mise/settings.toml
|
||||
'';
|
||||
};
|
||||
}
|
||||
7
tests/modules/programs/mise/default.nix
Normal file
7
tests/modules/programs/mise/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
mise-default-settings = ./default-settings.nix;
|
||||
mise-custom-settings = ./custom-settings.nix;
|
||||
mise-bash-integration = ./bash-integration.nix;
|
||||
mise-zsh-integration = ./zsh-integration.nix;
|
||||
mise-fish-integration = ./fish-integration.nix;
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{ config, ... }: {
|
||||
programs = {
|
||||
rtx = {
|
||||
package = config.lib.test.mkStubPackage { name = "rtx"; };
|
||||
mise = {
|
||||
package = config.lib.test.mkStubPackage { name = "mise"; };
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileRegex home-files/.config/fish/config.fish '/nix/store/.*rtx.*/bin/rtx activate fish | source'
|
||||
assertFileRegex home-files/.config/fish/config.fish '/nix/store/.*mise.*/bin/mise activate fish | source'
|
||||
'';
|
||||
}
|
||||
|
||||
16
tests/modules/programs/mise/zsh-integration.nix
Normal file
16
tests/modules/programs/mise/zsh-integration.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ config, ... }: {
|
||||
programs = {
|
||||
mise = {
|
||||
package = config.lib.test.mkStubPackage { name = "mise"; };
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
zsh.enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileRegex home-files/.zshrc 'eval "$(/nix/store/.*mise.*/bin/mise activate zsh)"'
|
||||
'';
|
||||
}
|
||||
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
{ config, ... }: {
|
||||
programs = {
|
||||
rtx = {
|
||||
package = config.lib.test.mkStubPackage { name = "rtx"; };
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
};
|
||||
|
||||
bash.enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileRegex home-files/.bashrc 'eval "$(/nix/store/.*rtx.*/bin/rtx activate bash)"'
|
||||
'';
|
||||
}
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
programs = {
|
||||
rtx = {
|
||||
package = config.lib.test.mkStubPackage { name = "rtx"; };
|
||||
enable = true;
|
||||
settings = {
|
||||
tools = {
|
||||
node = "lts";
|
||||
python = [ "3.10" "3.11" ];
|
||||
};
|
||||
|
||||
settings = {
|
||||
verbose = false;
|
||||
experimental = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/rtx/config.toml
|
||||
|
||||
assertFileContent home-files/.config/rtx/config.toml ${
|
||||
pkgs.writeText "rtx.expected" ''
|
||||
[settings]
|
||||
experimental = false
|
||||
verbose = false
|
||||
|
||||
[tools]
|
||||
node = "lts"
|
||||
python = ["3.10", "3.11"]
|
||||
''
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{ config, ... }: {
|
||||
config = {
|
||||
programs.rtx = {
|
||||
package = config.lib.test.mkStubPackage { name = "rtx"; };
|
||||
enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/rtx/config.toml
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
rtx-default-settings = ./default-settings.nix;
|
||||
rtx-custom-settings = ./custom-settings.nix;
|
||||
rtx-bash-integration = ./bash-integration.nix;
|
||||
rtx-zsh-integration = ./zsh-integration.nix;
|
||||
rtx-fish-integration = ./fish-integration.nix;
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
{ config, ... }: {
|
||||
programs = {
|
||||
rtx = {
|
||||
package = config.lib.test.mkStubPackage { name = "rtx"; };
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
zsh.enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileRegex home-files/.zshrc 'eval "$(/nix/store/.*rtx.*/bin/rtx activate zsh)"'
|
||||
'';
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue