From eb2dc61c70748f2bbccd75efadc0673d79ae1956 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 11 Jun 2025 18:20:02 +0300 Subject: [PATCH] nix: filter source --- nix/package.nix | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/nix/package.nix b/nix/package.nix index b49dd3ee..e6a626c7 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -1,20 +1,28 @@ { lib, rustPlatform, -}: -rustPlatform.buildRustPackage (finalAttrs: { - pname = "mrc"; - version = "0.1.0"; - src = builtins.path { - path = ../.; - name = "mrc"; - }; +}: let + fs = lib.fileset; + s = ../.; +in + rustPlatform.buildRustPackage (finalAttrs: { + pname = "mrc"; + version = "0.1.0"; + src = fs.toSource { + root = s; + 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; - meta = { - description = "IPC wrapper & command-line controller for MPV, the video player "; - mainProgram = "mrc"; - license = lib.licenses.mpl20; - }; -}) + meta = { + description = "IPC wrapper & command-line controller for MPV, the video player "; + mainProgram = "mrc"; + license = lib.licenses.mpl20; + maintainers = [lib.maintainers.NotAShelf]; + }; + })