main
 1{
 2  lib,
 3  rustPlatform,
 4  makeWrapper,
 5  gh,
 6}:
 7
 8rustPlatform.buildRustPackage (finalAttrs: {
 9  pname = "github-notif-manager";
10  version = "0.3.0";
11
12  src = lib.fileset.toSource {
13    root = ./.;
14    fileset = lib.fileset.intersection (lib.fileset.fromSource (lib.sources.cleanSource ./.)) (
15      lib.fileset.unions [
16        ./Cargo.toml
17        ./Cargo.lock
18        ./src
19      ]
20    );
21  };
22
23  cargoLock.lockFile = ./Cargo.lock;
24
25  nativeBuildInputs = [ makeWrapper ];
26
27  postInstall = ''
28    wrapProgram $out/bin/github-notif-manager \
29      --prefix PATH : ${lib.makeBinPath [ gh ]}
30  '';
31
32  meta = {
33    description = "Rule-based GitHub notification automation";
34    license = lib.licenses.mit;
35    platforms = lib.platforms.unix;
36    mainProgram = finalAttrs.pname;
37  };
38})