diff options
| author | Fuwn <[email protected]> | 2024-09-16 19:00:22 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-09-16 19:01:18 -0700 |
| commit | d1525c29af2f0c58fd4970fc33cc641cb460bbef (patch) | |
| tree | 8e930859a82585e1b29a5ab595197dbd14d7c537 /lib | |
| download | tsutsumi-d1525c29af2f0c58fd4970fc33cc641cb460bbef.tar.xz tsutsumi-d1525c29af2f0c58fd4970fc33cc641cb460bbef.zip | |
feat: initial release
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/build-rust-package.nix | 42 |
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; + }; +} |