1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00
nix/doc/manual/package.nix
Robert Hensing 132c20872f doc/manual: Render unreleased release notes on master
This renders the rl-next notes when `officialRelease = false`, which
corresponds to the case where we're not on a release branch.

Previously we had disabled this behavior because changelog-d is
somewhat of a heavy dependency, being the only Haskell package.
However, we now have new circumstances that topple the tradeoff.

- We render `master` docs to https://nix.dev/manual/nix/development/release-notes/rl-next.html

- `.#manual` is a separate build now, so `nix build nix/foo` is
  not affected by the increased closure of build input outputs.

Because of these factors, I believe adding this functionality back
is more valuable, as we can use it to

- Previous release notes

- Showcase the upcoming release to the community
2025-05-14 23:03:33 +02:00

85 lines
1.5 KiB
Nix

{
lib,
mkMesonDerivation,
meson,
ninja,
lowdown-unsandboxed,
mdbook,
mdbook-linkcheck,
jq,
python3,
rsync,
nix-cli,
changelog-d,
officialRelease,
# Configuration Options
version,
}:
let
inherit (lib) fileset;
in
mkMesonDerivation (finalAttrs: {
pname = "nix-manual";
inherit version;
workDir = ./.;
fileset =
fileset.difference
(fileset.unions [
../../.version
# Too many different types of files to filter for now
../../doc/manual
./.
])
# Do a blacklist instead
../../doc/manual/package.nix;
# TODO the man pages should probably be separate
outputs = [
"out"
"man"
];
# Hack for sake of the dev shell
passthru.externalNativeBuildInputs =
[
meson
ninja
(lib.getBin lowdown-unsandboxed)
mdbook
mdbook-linkcheck
jq
python3
rsync
changelog-d
]
++ lib.optionals (!officialRelease) [
# When not an official release, we likely have changelog entries that have
# yet to be rendered.
# When released, these are rendered into a committed file to save a dependency.
changelog-d
];
nativeBuildInputs = finalAttrs.passthru.externalNativeBuildInputs ++ [
nix-cli
];
preConfigure = ''
chmod u+w ./.version
echo ${finalAttrs.version} > ./.version
'';
postInstall = ''
mkdir -p ''$out/nix-support
echo "doc manual ''$out/share/doc/nix/manual" >> ''$out/nix-support/hydra-build-products
'';
meta = {
platforms = lib.platforms.all;
};
})