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 Sep 30, 2024
1 parent 8aa0207 commit 77dbc45
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 77dbc45

Please sign in to comment.