From cfcdbad6375bc115b1cf09b98c38f0cb2703c209 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 7 Jun 2025 02:38:06 +0100 Subject: [PATCH] =?UTF-8?q?nixos/man-db:=20fix=20cross=E2=80=90compilation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I don’t love this, but it seems to be the best we can do. --- nixos/modules/misc/man-db.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nixos/modules/misc/man-db.nix b/nixos/modules/misc/man-db.nix index 56b935c97597..dc6af4fe9692 100644 --- a/nixos/modules/misc/man-db.nix +++ b/nixos/modules/misc/man-db.nix @@ -69,10 +69,19 @@ in environment.systemPackages = [ cfg.package ]; environment.etc."man_db.conf".text = let + # We unfortunately can’t use the customized `cfg.package` when + # cross‐compiling. Instead we detect that situation and work + # around it by using the vanilla one, like the OpenSSH module. + buildPackage = + if pkgs.stdenv.buildPlatform.canExecute pkgs.stdenv.hostPlatform then + cfg.package + else + pkgs.buildPackages.man-db; + manualCache = pkgs.runCommand "man-cache" { - nativeBuildInputs = [ cfg.package ]; + nativeBuildInputs = [ buildPackage ]; } '' echo "MANDB_MAP ${cfg.manualPages}/share/man $out" > man.conf