2024-08-04 04:08:34 +02:00
|
|
|
{
|
|
|
|
lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, makeWrapper
|
|
|
|
, mpv
|
2024-10-20 22:51:05 +02:00
|
|
|
, wrapped ? false
|
2024-08-04 04:08:34 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "greg-ng";
|
|
|
|
version = "0.1.0";
|
2024-10-20 19:48:23 +02:00
|
|
|
src = builtins.filterSource (path: type: let
|
|
|
|
baseName = baseNameOf (toString path);
|
|
|
|
in !(lib.any (b: b) [
|
|
|
|
(!(lib.cleanSourceFilter path type))
|
2024-10-20 22:06:51 +02:00
|
|
|
(type == "directory" && lib.elem baseName [
|
|
|
|
".direnv"
|
|
|
|
".git"
|
|
|
|
"target"
|
|
|
|
"result"
|
|
|
|
])
|
|
|
|
(type == "regular" && lib.elem baseName [
|
|
|
|
"flake.nix"
|
|
|
|
"default.nix"
|
|
|
|
"module.nix"
|
|
|
|
".envrc"
|
|
|
|
])
|
2024-10-20 19:48:23 +02:00
|
|
|
])) ./.;
|
|
|
|
|
2024-08-04 04:08:34 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"mpvipc-async-0.1.0" = "sha256-2TQ2d4q9/DTxTZe9kOAoKBhsmegRZw32x3G2hbluS6U=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-10-20 22:51:05 +02:00
|
|
|
postInstall = lib.optionalString wrapped ''
|
2024-08-04 04:08:34 +02:00
|
|
|
wrapProgram $out/bin/greg-ng \
|
|
|
|
--prefix PATH : '${lib.makeBinPath [ mpv ]}'
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ h7x4 ];
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
mainProgram = "greg-ng";
|
|
|
|
};
|
|
|
|
}
|