diff --git a/default.nix b/default.nix index 097662b..c02f3a5 100644 --- a/default.nix +++ b/default.nix @@ -14,7 +14,18 @@ stdenv.mkDerivation { name = "openemsh"; version = "0.0.0"; - src = ./.; + src = lib.nix-filter { + root = ./.; + include = [ + "cmake" + "src" + "doc" + "icon" + "test" + "CMakeLists.txt" + "CMakePresets.json" + ]; + }; nativeBuildInputs = [ cmake diff --git a/flake.nix b/flake.nix index 9bb0bcf..437412d 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,8 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/22.11"; + nix-filter.url = "github:numtide/nix-filter"; + flake-utils.url = "github:numtide/flake-utils"; cmake-utils = { @@ -17,11 +19,15 @@ outputs = { self , nixpkgs + , nix-filter , cmake-utils , flake-utils , ... }@inputs: - flake-utils.lib.eachDefaultSystem (system: + let + lib = nixpkgs.lib.extend nix-filter.overlays.default; + + in flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [ cmake-utils.overlays.pkgs @@ -64,6 +70,7 @@ overlays = { pkgs = final: prev: { openemsh = prev.callPackage ./default.nix { + inherit lib; stdenv = prev.llvmPackages_13.stdenv; };