Skip to content

Commit

Permalink
setup: simplify - use file exts instead of regexes
Browse files Browse the repository at this point in the history
  • Loading branch information
igordejanovic committed Jun 8, 2024
1 parent e4bd0d1 commit f672641
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docs/default.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{ pkgs, crane, mdbook-theme }:
let
inherit (pkgs) stdenv lib;

craneLib = crane.mkLib pkgs;

mdbook-theme-pkg = pkgs.rustPlatform.buildRustPackage {
pname = "mdbook-theme";
version = "0.1.4";
cargoLock.lockFile = mdbook-theme.outPath + "/Cargo.lock";
src = mdbook-theme;
};

craneLib = crane.mkLib pkgs;

tex = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-small standalone qtree pict2e preview;
};
Expand All @@ -21,8 +20,8 @@ let
mdbook-graphviz mdbook-theme-pkg mdbook-linkcheck
plantuml graphviz tex poppler_utils];

docsFileTypes = [ ".*md$" ".*rustemo$" ".*err$" ".*ast$" ".*tex$" ".*png$" ".*css$" ".*js$" ".*sh$"];
docsFilter = path: _type: builtins.any (pattern: builtins.match pattern path != null) docsFileTypes;
docsFileTypes = [ ".md" ".rustemo" ".err" ".ast" ".tex" ".png" ".css" ".js" ".sh"];
docsFilter = path: _type: builtins.any (ext: lib.hasSuffix ext path) docsFileTypes;
docsOrCargoFilter = path: type:
(docsFilter path type) || (craneLib.filterCargoSources path type);

Expand Down

0 comments on commit f672641

Please sign in to comment.