From c7134f0d069bacaa3195c882d89b4f913b532f92 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 24 Jun 2025 19:32:42 +0200 Subject: [PATCH] flake.nix: filter `src` --- flake.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index be9a938..afcb025 100644 --- a/flake.nix +++ b/flake.nix @@ -104,10 +104,24 @@ platforms = lib.platforms.all; }; - src = lib.cleanSource ./.; + src = builtins.filterSource (path: type: let + baseName = baseNameOf (toString path); + in !(lib.any (b: b) [ + (!(lib.cleanSourceFilter path type)) + (baseName == ".github" && type == "directory") + (baseName == "nix" && type == "directory") + (baseName == ".envrc" && type == "regular") + (baseName == "flake.lock" && type == "regular") + (baseName == "flake.nix" && type == "regular") + ])) ./.; + in forAllSystems (system: pkgs: { default = self.packages.${system}.database; + filteredSource = pkgs.runCommandLocal "filtered-source" { } '' + ln -s ${src} $out + ''; + jmdict = pkgs.callPackage ./nix/jmdict.nix { inherit jmdict-src jmdict-with-examples-src edrdgMetadata; };