rtx: add module (#4051)
This commit is contained in:
parent
28614ed7a1
commit
3512a6dafb
10 changed files with 193 additions and 0 deletions
16
tests/modules/programs/rtx/bash-integration.nix
Normal file
16
tests/modules/programs/rtx/bash-integration.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ 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)"'
|
||||
'';
|
||||
}
|
||||
|
||||
35
tests/modules/programs/rtx/custom-settings.nix
Normal file
35
tests/modules/programs/rtx/custom-settings.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ 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"]
|
||||
''
|
||||
}
|
||||
'';
|
||||
}
|
||||
12
tests/modules/programs/rtx/default-settings.nix
Normal file
12
tests/modules/programs/rtx/default-settings.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ config, ... }: {
|
||||
config = {
|
||||
programs.rtx = {
|
||||
package = config.lib.test.mkStubPackage { name = "rtx"; };
|
||||
enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/rtx/config.toml
|
||||
'';
|
||||
};
|
||||
}
|
||||
7
tests/modules/programs/rtx/default.nix
Normal file
7
tests/modules/programs/rtx/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
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;
|
||||
}
|
||||
16
tests/modules/programs/rtx/fish-integration.nix
Normal file
16
tests/modules/programs/rtx/fish-integration.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ config, ... }: {
|
||||
programs = {
|
||||
rtx = {
|
||||
package = config.lib.test.mkStubPackage { name = "rtx"; };
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
fish.enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileRegex home-files/.config/fish/config.fish '/nix/store/.*rtx.*/bin/rtx activate fish | source'
|
||||
'';
|
||||
}
|
||||
|
||||
16
tests/modules/programs/rtx/zsh-integration.nix
Normal file
16
tests/modules/programs/rtx/zsh-integration.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ 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