From f672641d8da36bca4cfdff7653b6c11da67b79e3 Mon Sep 17 00:00:00 2001 From: Igor Dejanovic Date: Sat, 8 Jun 2024 15:21:53 +0200 Subject: [PATCH] setup: simplify - use file exts instead of regexes --- docs/default.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/default.nix b/docs/default.nix index a04e9fb0..ad0de8cf 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -1,7 +1,8 @@ { 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"; @@ -9,8 +10,6 @@ let src = mdbook-theme; }; - craneLib = crane.mkLib pkgs; - tex = pkgs.texlive.combine { inherit (pkgs.texlive) scheme-small standalone qtree pict2e preview; }; @@ -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);