Skip to content

Commit b65290b

Browse files
committed
refactor: use lib.fileset in docs derivation
1 parent 4b022f7 commit b65290b

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

docs/default.nix

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
{ mdbook
22
, modules-docs
33
, stdenv
4+
, lib
45
}:
5-
let
6-
source = import ../nix/source.nix;
7-
in
6+
with lib;
87
stdenv.mkDerivation {
98
name = "devshell-docs";
109
buildInputs = [ mdbook ];
11-
src = source.filter {
12-
path = ./.;
13-
allow = [
14-
./book.toml
15-
(source.matchExt "md")
16-
];
17-
};
10+
src =
11+
let fs = lib.fileset; in
12+
fs.toSource {
13+
root = ./.;
14+
fileset = fs.unions [
15+
(fs.fileFilter (file: file.hasExt "md") ./src)
16+
(fs.fileFilter (file: true) ./theme)
17+
./book.toml
18+
];
19+
};
1820

1921
buildPhase = ''
20-
cp ${modules-docs.markdown} modules_schema.md
22+
cp ${modules-docs.markdown} src/modules_schema.md
2123
mdbook build
2224
'';
2325

0 commit comments

Comments
 (0)