Skip to content

Commit

Permalink
rtx: rename to mise
Browse files Browse the repository at this point in the history
  • Loading branch information
pedorich-n committed Jan 16, 2024
1 parent 37d6eec commit 8fea269
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 71 deletions.
7 changes: 7 additions & 0 deletions modules/misc/news.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,13 @@ in {
A new module is available: 'xdg.portal'.
'';
}

{
time = "2024-01-16T15:43:51+00:00";
message = ''
'programs.rtx' was renamed to 'programs.mise'
'';
}
];
};
}
2 changes: 1 addition & 1 deletion modules/modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ let
./programs/mcfly.nix
./programs/mercurial.nix
./programs/micro.nix
./programs/mise.nix
./programs/mpv.nix
./programs/mr.nix
./programs/msmtp.nix
Expand Down Expand Up @@ -194,7 +195,6 @@ let
./programs/rofi-pass.nix
./programs/rofi.nix
./programs/rtorrent.nix
./programs/rtx.nix
./programs/ruff.nix
./programs/sagemath.nix
./programs/sapling.nix
Expand Down
20 changes: 10 additions & 10 deletions modules/programs/rtx.nix → modules/programs/mise.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
with lib;

let
cfg = config.programs.rtx;
cfg = config.programs.mise;
tomlFormat = pkgs.formats.toml { };
in {
meta.maintainers = [ hm.maintainers.pedorich-n ];

options = {
programs.rtx = {
enable = mkEnableOption "RTX. Runtime Executor (asdf Rust clone)";
programs.mise = {
enable = mkEnableOption "mise. Runtime Executor (asdf Rust clone)";

package = mkPackageOption pkgs "rtx" { };
package = mkPackageOption pkgs "mise" { };

enableBashIntegration = mkEnableOption "Bash Integration" // {
default = true;
Expand Down Expand Up @@ -41,14 +41,14 @@ in {
};
'';
description = ''
Settings written to {file}`$XDG_CONFIG_HOME/rtx/config.toml`.
Settings written to {file}`$XDG_CONFIG_HOME/mise/config.toml`.
See <https://github.com/jdxcode/rtx#global-config-configrtxconfigtoml>
See <https://mise.jdx.dev/configuration.html#global-config-config-mise-config-toml>
for details on supported values.
::: {.warning}
Modifying the `tools` section doesn't make RTX install them.
You have to manually run `rtx install` to install the tools.
Modifying the `tools` section doesn't make mise install them.
You have to manually run `mise install` to install the tools.
:::
'';
};
Expand All @@ -58,8 +58,8 @@ in {
config = mkIf cfg.enable {
home.packages = [ cfg.package ];

xdg.configFile."rtx/config.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "rtx-settings" cfg.settings;
xdg.configFile."mise/config.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "mise-settings" cfg.settings;
};

programs = {
Expand Down
2 changes: 1 addition & 1 deletion tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ in import pkgs.nix-lib-nmt {
./modules/programs/man
./modules/programs/mbsync
./modules/programs/micro
./modules/programs/mise
./modules/programs/mpv
./modules/programs/mu
./modules/programs/mujmap
Expand Down Expand Up @@ -123,7 +124,6 @@ in import pkgs.nix-lib-nmt {
./modules/programs/readline
./modules/programs/rio
./modules/programs/ripgrep
./modules/programs/rtx
./modules/programs/ruff
./modules/programs/sagemath
./modules/programs/sapling
Expand Down
16 changes: 16 additions & 0 deletions tests/modules/programs/mise/bash-integration.nix
Original file line number Diff line number Diff line change
@@ -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)"'
'';
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ config, pkgs, ... }: {
programs = {
rtx = {
package = config.lib.test.mkStubPackage { name = "rtx"; };
mise = {
package = config.lib.test.mkStubPackage { name = "mise"; };
enable = true;
settings = {
tools = {
Expand All @@ -18,10 +18,10 @@
};

nmt.script = ''
assertFileExists home-files/.config/rtx/config.toml
assertFileExists home-files/.config/mise/config.toml
assertFileContent home-files/.config/rtx/config.toml ${
pkgs.writeText "rtx.expected" ''
assertFileContent home-files/.config/mise/config.toml ${
pkgs.writeText "mise.expected" ''
[settings]
experimental = false
verbose = false
Expand Down
12 changes: 12 additions & 0 deletions tests/modules/programs/mise/default-settings.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ config, ... }: {
config = {
programs.mise = {
package = config.lib.test.mkStubPackage { name = "mise"; };
enable = true;
};

nmt.script = ''
assertPathNotExists home-files/.config/mise/config.toml
'';
};
}
7 changes: 7 additions & 0 deletions tests/modules/programs/mise/default.nix
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
};
Expand All @@ -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 changes: 16 additions & 0 deletions tests/modules/programs/mise/zsh-integration.nix
Original file line number Diff line number Diff line change
@@ -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)"'
'';
}

16 changes: 0 additions & 16 deletions tests/modules/programs/rtx/bash-integration.nix

This file was deleted.

12 changes: 0 additions & 12 deletions tests/modules/programs/rtx/default-settings.nix

This file was deleted.

7 changes: 0 additions & 7 deletions tests/modules/programs/rtx/default.nix

This file was deleted.

16 changes: 0 additions & 16 deletions tests/modules/programs/rtx/zsh-integration.nix

This file was deleted.

0 comments on commit 8fea269

Please sign in to comment.