diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index a7b3d12f7a5d..6ba5135fdd6c 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -24,6 +24,8 @@ common = , withLibseccomp ? lib.meta.availableOn stdenv.hostPlatform libseccomp, libseccomp , withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin), aws-sdk-cpp , enableStatic ? stdenv.hostPlatform.isStatic + , enableDocumentation ? lib.versionOlder version "2.4pre" || + stdenv.hostPlatform == stdenv.buildPlatform , pname, version, suffix ? "", src , patches ? [ ] }: @@ -36,16 +38,20 @@ common = VERSION_SUFFIX = suffix; - outputs = [ "out" "dev" "man" "doc" ]; + outputs = + [ "out" "dev" ] + ++ lib.optionals enableDocumentation [ "man" "doc" ]; nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.isLinux [ util-linuxMinimal ] + ++ lib.optionals (is24 && enableDocumentation) [ + (lib.getBin lowdown) mdbook + ] ++ lib.optionals is24 [ autoreconfHook autoconf-archive bison flex - (lib.getBin lowdown) mdbook jq ]; @@ -118,6 +124,7 @@ common = "--sysconfdir=${confDir}" "--enable-gc" ] + ++ lib.optional (!enableDocumentation) "--disable-doc-gen" ++ lib.optionals (!is24) [ # option was removed in 2.4 "--disable-init-state" @@ -160,7 +167,7 @@ common = license = lib.licenses.lgpl2Plus; maintainers = [ lib.maintainers.eelco ]; platforms = lib.platforms.unix; - outputsToInstall = [ "out" "man" ]; + outputsToInstall = [ "out" ] ++ lib.optional enableDocumentation "man"; }; passthru = {