templates: add a pure `rust` package template

This commit is contained in:
Colin 2023-04-26 07:41:08 +00:00
parent 83e404f000
commit d617c0259f
2 changed files with 32 additions and 1 deletions

View File

@ -294,7 +294,13 @@
# initialize with:
# - `nix flake init -t '/home/colin/dev/nixos/#pkgs.rust-inline'`
path = ./templates/pkgs/rust-inline;
description = "rust package and development environment";
description = "rust package and development environment (inline rust sources)";
};
pkgs.rust = {
# initialize with:
# - `nix flake init -t '/home/colin/dev/nixos/#pkgs.rust'`
path = ./templates/pkgs/rust;
description = "rust package fit to ship in nixpkgs";
};
};
};

View File

@ -0,0 +1,25 @@
{ lib
, rustPlatform
, fetchFromGitHub
}:
rustPlatform.buildRustPackage rec {
pname = "elfcat";
version = "0.1.8";
src = fetchFromGitHub {
owner = "ruslashev";
repo = pname;
rev = version;
sha256 = "sha256-NzFKNCCPWBj/fhaEJF34nyeyvLMeQwIcQgTlYc6mgYo=";
};
cargoHash = "sha256-Dc+SuLwbLFcNSr9RiNSc7dgisBOvOUEIDR8dFAkC/O0=";
meta = with lib; {
description = "TODO: FILLME";
homepage = "https://github.com/ruslashev/elfcat";
license = licenses.zlib;
maintainers = with maintainers; [ colinsane ];
};
}