factor out nix code into new files via makeScope

This makes the Nix code a lot easier to reason about.
This commit is contained in:
Charles Hall 2024-04-30 16:00:19 -07:00 committed by Matthias Ahouansou
parent c9ee4a920e
commit 3336d3f812
No known key found for this signature in database
6 changed files with 357 additions and 268 deletions

34
nix/pkgs/book/default.nix Normal file
View file

@ -0,0 +1,34 @@
# Keep sorted
{ default
, inputs
, mdbook
, stdenv
}:
stdenv.mkDerivation {
pname = "${default.pname}-book";
version = default.version;
src = let filter = inputs.nix-filter.lib; in filter {
root = inputs.self;
# Keep sorted
include = [
"book.toml"
"conduit-example.toml"
"debian/README.md"
"docs"
"README.md"
];
};
nativeBuildInputs = [
mdbook
];
buildPhase = ''
mdbook build
mv public $out
'';
}