rtx: add module (#4051)

This commit is contained in:
Nikita Pedorich 2023-06-07 10:32:56 +02:00 committed by GitHub
parent 28614ed7a1
commit 3512a6dafb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 193 additions and 0 deletions

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

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

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

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

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

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