mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 15:21:24 +01:00
add flake output for the website root
This commit is contained in:
parent
af15f0c596
commit
2bf1975e75
4 changed files with 34 additions and 2 deletions
|
|
@ -57,7 +57,8 @@ pages:
|
|||
stage: deploy
|
||||
image: nixos/nix:2.18.2
|
||||
script:
|
||||
- direnv exec . mdbook build
|
||||
- nix build .#website-root
|
||||
- cp --recursive --dereference result public
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ multilingual = false
|
|||
src = "book"
|
||||
|
||||
[build]
|
||||
build-dir = "public"
|
||||
build-dir = "target/book"
|
||||
|
||||
[output.html]
|
||||
git-repository-icon = "fa-git-square"
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@
|
|||
(fenix.targets.${target}.fromManifestFile inputs.rust-manifest)
|
||||
.withComponents components)
|
||||
targets);
|
||||
|
||||
website-root = self.callPackage ./nix/pkgs/website-root {};
|
||||
});
|
||||
in
|
||||
inputs.flake-utils.lib.eachDefaultSystem (system:
|
||||
|
|
@ -81,6 +83,7 @@
|
|||
{
|
||||
packages = {
|
||||
default = (mkScope pkgs).default;
|
||||
website-root = (mkScope pkgs).website-root;
|
||||
}
|
||||
//
|
||||
builtins.listToAttrs
|
||||
|
|
|
|||
28
nix/pkgs/website-root/default.nix
Normal file
28
nix/pkgs/website-root/default.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Keep sorted
|
||||
{ inputs
|
||||
, lib
|
||||
, mdbook
|
||||
, stdenv
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "website-root";
|
||||
|
||||
src = let filter = inputs.nix-filter.lib; in filter {
|
||||
root = inputs.self;
|
||||
|
||||
# Keep sorted
|
||||
include = [
|
||||
"book"
|
||||
"book.toml"
|
||||
];
|
||||
};
|
||||
|
||||
buildPhase = ''
|
||||
${lib.getExe mdbook} build
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mv target/book $out
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue