about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/mise/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/mise/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/misc/mise/default.nix79
1 files changed, 79 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/misc/mise/default.nix b/nixpkgs/pkgs/tools/misc/mise/default.nix
new file mode 100644
index 000000000000..c82603b93039
--- /dev/null
+++ b/nixpkgs/pkgs/tools/misc/mise/default.nix
@@ -0,0 +1,79 @@
+{ lib
+, nix-update-script
+, rustPlatform
+, fetchFromGitHub
+, installShellFiles
+, stdenv
+, coreutils
+, bash
+, pkg-config
+, openssl
+, direnv
+, Security
+, SystemConfiguration
+, mise
+, testers
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "mise";
+  version = "2024.1.20";
+
+  src = fetchFromGitHub {
+    owner = "jdx";
+    repo = "mise";
+    rev = "v${version}";
+    hash = "sha256-4KyvqxM7QpszTGIzSrd0nrnO1yk/hkjmbRqVzzlMuYI=";
+  };
+
+  cargoHash = "sha256-Mq9uN0pztH5DwVCPNtl58zDPZtyWBsoTTMriUK6w8iI=";
+
+  nativeBuildInputs = [ installShellFiles pkg-config ];
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security SystemConfiguration ];
+
+  postPatch = ''
+    patchShebangs --build \
+      ./test/data/plugins/**/bin/* \
+      ./src/fake_asdf.rs \
+      ./src/cli/reshim.rs \
+      ./test/cwd/.mise/tasks/filetask
+
+    substituteInPlace ./src/env_diff.rs \
+      --replace '"bash"' '"${bash}/bin/bash"'
+
+    substituteInPlace ./src/cli/direnv/exec.rs \
+      --replace '"env"' '"${coreutils}/bin/env"' \
+      --replace 'cmd!("direnv"' 'cmd!("${direnv}/bin/direnv"'
+  '';
+
+  checkFlags = [
+    # Requires .git directory to be present
+    "--skip=cli::plugins::ls::tests::test_plugin_list_urls"
+  ];
+  cargoTestFlags = [ "--all-features" ];
+  # some tests access the same folders, don't test in parallel to avoid race conditions
+  dontUseCargoParallelTests = true;
+
+  postInstall = ''
+    installManPage ./man/man1/mise.1
+
+    installShellCompletion \
+      --bash ./completions/mise.bash \
+      --fish ./completions/mise.fish \
+      --zsh ./completions/_mise
+  '';
+
+  passthru = {
+    updateScript = nix-update-script { };
+    tests.version = testers.testVersion { package = mise; };
+  };
+
+  meta = {
+    homepage = "https://mise.jdx.dev";
+    description = "The front-end to your dev env";
+    changelog = "https://github.com/jdx/mise/releases/tag/v${version}";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ konradmalik ];
+    mainProgram = "mise";
+  };
+}