mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
docs/mdbook: use a fileset union for source
This commit is contained in:
parent
c2dbf7acf1
commit
c477b7865e
1 changed files with 23 additions and 10 deletions
|
@ -292,21 +292,34 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
|
|||
pkgs.mdbook-alerts
|
||||
];
|
||||
|
||||
inputs = lib.sourceFilesBySuffices ./. [
|
||||
".md"
|
||||
".toml"
|
||||
".js"
|
||||
];
|
||||
# Build a source from the fileset containing the following paths,
|
||||
# as well as all .md, .toml, & .js files in this directory
|
||||
src = lib.fileset.toSource {
|
||||
root = ../../.;
|
||||
fileset = lib.fileset.unions [
|
||||
../user-guide
|
||||
../modules
|
||||
../../CONTRIBUTING.md
|
||||
(lib.fileset.fileFilter (
|
||||
{ type, hasExt, ... }:
|
||||
type == "regular"
|
||||
&& lib.any hasExt [
|
||||
"md"
|
||||
"toml"
|
||||
"js"
|
||||
]
|
||||
) ./.)
|
||||
];
|
||||
};
|
||||
|
||||
buildPhase = ''
|
||||
dest=$out/share/doc/nixvim
|
||||
mkdir -p $dest
|
||||
|
||||
# Copy inputs into the build directory
|
||||
cp -r --no-preserve=all $inputs/* ./
|
||||
cp ${../../CONTRIBUTING.md} ./CONTRIBUTING.md
|
||||
cp -r ${../user-guide} ./user-guide
|
||||
cp -r ${../modules} ./modules
|
||||
# Copy (and flatten) src into the build directory
|
||||
cp -r --no-preserve=all $src/* ./
|
||||
mv ./docs/* ./ && rmdir ./docs
|
||||
mv ./mdbook/* ./ && rmdir ./mdbook
|
||||
|
||||
# Copy the generated MD docs into the build directory
|
||||
bash -e ${finalAttrs.passthru.copy-docs}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue