about summary refs log tree commit diff
path: root/pkgs/tools/nix/alejandra/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/nix/alejandra/default.nix')
-rw-r--r--pkgs/tools/nix/alejandra/default.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/pkgs/tools/nix/alejandra/default.nix b/pkgs/tools/nix/alejandra/default.nix
new file mode 100644
index 0000000000000..7ed599345ebe2
--- /dev/null
+++ b/pkgs/tools/nix/alejandra/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, testVersion
+, alejandra
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "alejandra";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "kamadorueda";
+    repo = "alejandra";
+    rev = version;
+    sha256 = "sha256-Gtz+z8ESIqY/2V6X/rLMweqio66IGaUVGmIT/Y20+JY=";
+  };
+
+  cargoSha256 = "sha256-kydMIbx5Fu7+uwXn7KrrNd1fhXZQ5sabX4TBYpvmimk=";
+
+  passthru.tests = {
+    version = testVersion { package = alejandra; };
+  };
+
+  meta = with lib; {
+    description = "The Uncompromising Nix Code Formatter";
+    homepage = "https://github.com/kamadorueda/alejandra";
+    license = licenses.unlicense;
+    maintainers = with maintainers; [ _0x4A6F kamadorueda ];
+  };
+}