Skip to content

Commit

Permalink
nix: we already depend on nix-filter, use it to filter sources of nix…
Browse files Browse the repository at this point in the history
…-shell (direnv)
  • Loading branch information
vlaci committed Oct 4, 2024
1 parent 04036e9 commit 9712158
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9712158

Please sign in to comment.