aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-16 19:00:22 -0700
committerFuwn <[email protected]>2024-09-16 19:01:18 -0700
commitd1525c29af2f0c58fd4970fc33cc641cb460bbef (patch)
tree8e930859a82585e1b29a5ab595197dbd14d7c537 /lib
downloadtsutsumi-d1525c29af2f0c58fd4970fc33cc641cb460bbef.tar.xz
tsutsumi-d1525c29af2f0c58fd4970fc33cc641cb460bbef.zip
feat: initial release
Diffstat (limited to 'lib')
-rw-r--r--lib/build-rust-package.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/build-rust-package.nix b/lib/build-rust-package.nix
new file mode 100644
index 0000000..4443e53
--- /dev/null
+++ b/lib/build-rust-package.nix
@@ -0,0 +1,42 @@
+{
+ lib,
+ rustPlatform,
+ fetchFromGitHub,
+}:
+{
+ pname,
+ version,
+ githubOwner,
+ githubHash,
+ cargoHash,
+ description ? null,
+ license,
+ maintainers ? null,
+ buildInputs ? [ ],
+ nativeBuildInputs ? [ ],
+}:
+rustPlatform.buildRustPackage rec {
+ inherit
+ pname
+ version
+ buildInputs
+ nativeBuildInputs
+ cargoHash
+ ;
+
+ src = fetchFromGitHub {
+ owner = githubOwner;
+ repo = pname;
+ rev = version;
+ hash = githubHash;
+ };
+
+ doCheck = false;
+
+ meta = with lib; {
+ inherit description license maintainers;
+
+ homepage = "https://github.com/${githubOwner}/${pname}";
+ mainProgram = pname;
+ };
+}