diff options
author | Coutinho de Souza <dev@onemoresuza.mailer.me> | 2024-03-06 11:10:27 -0300 |
---|---|---|
committer | Coutinho de Souza <dev@onemoresuza.mailer.me> | 2024-03-06 11:57:55 -0300 |
commit | 478cff8d326d7848fb9a8a1d242db7fe18688a61 (patch) | |
tree | 6bb387c0a017f4e5c729a9e0481f1817206c57e5 | |
parent | 8100cc1f54274cce1f185aa57455942dbf1f842e (diff) |
haredoc: init at 0.24.0
Also add a mention to the release notes of 24.05 about `hare` and `haredoc` being split into different packages.
-rw-r--r-- | nixos/doc/manual/release-notes/rl-2405.section.md | 2 | ||||
-rw-r--r-- | pkgs/by-name/ha/haredoc/package.nix | 55 |
2 files changed, 57 insertions, 0 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index daabca2aee609..c75b062dcfe87 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -152,6 +152,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m - `services.homepage-dashboard` now takes it's configuration using native Nix expressions, rather than dumping templated configurations into `/var/lib/homepage-dashboard` where they were previously managed manually. There are now new options which allow the configuration of bookmarks, services, widgets and custom CSS/JS natively in Nix. +- `hare` may now be cross-compiled. For that to work, however, `haredoc` needed to stop being built together with it. Thus, the latter is now its own package with the name of `haredoc`. + - The legacy and long deprecated systemd target `network-interfaces.target` has been removed. Use `network.target` instead. - `services.frp.settings` now generates the frp configuration file in TOML format as [recommended by upstream](https://github.com/fatedier/frp#configuration-files), instead of the legacy INI format. This has also introduced other changes in the configuration file structure and options. diff --git a/pkgs/by-name/ha/haredoc/package.nix b/pkgs/by-name/ha/haredoc/package.nix new file mode 100644 index 0000000000000..2476e7d937c50 --- /dev/null +++ b/pkgs/by-name/ha/haredoc/package.nix @@ -0,0 +1,55 @@ +{ lib +, stdenv +, scdoc +, hare +}: +let + arch = stdenv.hostPlatform.uname.processor; +in +stdenv.mkDerivation { + pname = "haredoc"; + outputs = [ "out" "man" ]; + inherit (hare) version src; + + strictDeps = true; + enableParallelBuilding = true; + + nativeBuildInputs = [ + scdoc + hare + ]; + + preBuild = '' + HARECACHE="$(mktemp -d)" + export HARECACHE + ''; + + buildPhase = '' + runHook preBuild + + hare build -qR -a ${arch} -o haredoc ./cmd/haredoc + scdoc <docs/haredoc.1.scd >haredoc.1 + scdoc <docs/haredoc.5.scd >haredoc.5 + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + install -Dm0755 ./haredoc $out/bin/haredoc + install -Dm0644 ./haredoc.1 $out/share/man/man1/haredoc.1 + install -Dm0644 ./haredoc.5 $out/share/man/man5/haredoc.5 + + runHook postInstall + ''; + + meta = { + homepage = "https://harelang.org/"; + description = "Hare's documentation tool"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ onemoresuza ]; + mainProgram = "haredoc"; + inherit (hare.meta) platforms badPlatforms; + }; +} |