nix: filter source

This commit is contained in:
raf 2025-06-11 18:20:02 +03:00
commit eb2dc61c70
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF

View file

@ -1,13 +1,20 @@
{ {
lib, lib,
rustPlatform, rustPlatform,
}: }: let
rustPlatform.buildRustPackage (finalAttrs: { fs = lib.fileset;
s = ../.;
in
rustPlatform.buildRustPackage (finalAttrs: {
pname = "mrc"; pname = "mrc";
version = "0.1.0"; version = "0.1.0";
src = builtins.path { src = fs.toSource {
path = ../.; root = s;
name = "mrc"; fileset = fs.unions [
(fs.fileFilter (file: builtins.any file.hasExt ["rs"]) (s + /src))
(s + /Cargo.lock)
(s + /Cargo.toml)
];
}; };
cargoLock.lockFile = finalAttrs.src + /Cargo.lock; cargoLock.lockFile = finalAttrs.src + /Cargo.lock;
@ -16,5 +23,6 @@ rustPlatform.buildRustPackage (finalAttrs: {
description = "IPC wrapper & command-line controller for MPV, the video player "; description = "IPC wrapper & command-line controller for MPV, the video player ";
mainProgram = "mrc"; mainProgram = "mrc";
license = lib.licenses.mpl20; license = lib.licenses.mpl20;
maintainers = [lib.maintainers.NotAShelf];
}; };
}) })