From 8ef4b6397f96934a8e0cbc9712ef85431d325f99 Mon Sep 17 00:00:00 2001 From: figsoda Date: Tue, 21 Sep 2021 12:50:46 -0400 Subject: [PATCH] rust-script: init at 0.17.0 --- .../tools/rust/rust-script/default.nix | 26 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 27 insertions(+) create mode 100644 pkgs/development/tools/rust/rust-script/default.nix diff --git a/pkgs/development/tools/rust/rust-script/default.nix b/pkgs/development/tools/rust/rust-script/default.nix new file mode 100644 index 000000000000..b13a1f66db2d --- /dev/null +++ b/pkgs/development/tools/rust/rust-script/default.nix @@ -0,0 +1,26 @@ +{ lib, rustPlatform, fetchFromGitHub }: + +rustPlatform.buildRustPackage rec { + pname = "rust-script"; + version = "0.17.0"; + + src = fetchFromGitHub { + owner = "fornwall"; + repo = pname; + rev = "v${version}"; + sha256 = "0jz8hlvl31c5h8whd6pnpmslw6w6alkxijd9lhgric1yypiym9x3"; + }; + + cargoSha256 = "sha256-hg0QtxR1qm/x8G6HoN7xAyOwh9jiQvX2wWYjUR8YvMs="; + + # TODO: switch to `cargoCheckType = "false"` after #138822 is merged + # tests only work in debug mode + doCheck = false; + + meta = with lib; { + description = "Run Rust files and expressions as scripts without any setup or compilation step"; + homepage = "https://rust-script.org"; + license = with licenses; [ mit /* or */ asl20 ]; + maintainers = with maintainers; [ figsoda ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7b56ef9bbf65..c741d0c68459 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12508,6 +12508,7 @@ with pkgs; rust-cbindgen = callPackage ../development/tools/rust/cbindgen { inherit (darwin.apple_sdk.frameworks) Security; }; + rust-script = callPackage ../development/tools/rust/rust-script { }; rustup = callPackage ../development/tools/rust/rustup { inherit (darwin.apple_sdk.frameworks) CoreServices Security; };