From 971215821abfb60d7252da3604422f5d27d494b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:21:10 +0200 Subject: [PATCH] nix: we already depend on nix-filter, use it to filter sources of nix-shell (direnv) --- shell.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/shell.nix b/shell.nix index 002e0f2e5c..d933ce93f8 100644 --- a/shell.nix +++ b/shell.nix @@ -12,13 +12,14 @@ let url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; sha256 = lock.nodes.flake-compat.locked.narHash; }; + nix-filter = import (fetchTarball { + url = "https://github.com/numtide/nix-filter/archive/${lock.nodes.filter.locked.rev}.tar.gz"; + sha256 = lock.nodes.filter.locked.narHash; + }); - startsWith = pref: str: with builtins; substring 0 (stringLength pref) str == pref; - - src = builtins.path { - path = ./.; - name = "source"; - filter = path: type: builtins.any (x: startsWith (toString x) path) flakeManifest; + src = nix-filter { + root = ./.; + include = flakeManifest; }; in (import flake-compat { inherit src; }).shellNix.default