nixos/install-tools: Add manpages to packages instead of seperating them

Since each such `nixos-*` tool has it's own derivation, exposed in pkgs,
There is no point in separating the manuals from the packages. If
someone wishes to have the tools without the manuals, they can use
meta.outputsToInstall to disable the installation of the manpages of
these packages. This Fixes #244450.
This commit is contained in:
Doron Behar 2023-08-12 13:13:14 +03:00
parent 9d0bb6e67a
commit 32f75a0f2a
11 changed files with 16 additions and 8 deletions

View File

@ -184,8 +184,8 @@ in rec {
'';
# Generate the NixOS manpages.
manpages = runCommand "nixos-manpages"
# Generate the configuration.nix manual package
configuration-manual = runCommand "nixos-manpages"
{ nativeBuildInputs = [
buildPackages.installShellFiles
buildPackages.nixos-render-docs
@ -194,8 +194,6 @@ in rec {
}
''
# Generate manpages.
mkdir -p $out/share/man/man8
installManPage ${./manpages}/*
mkdir -p $out/share/man/man5
nixos-render-docs -j $NIX_BUILD_CORES options manpage \
--revision ${lib.escapeShellArg revision} \

View File

@ -9,12 +9,19 @@ let
makeProg = args: pkgs.substituteAll (args // {
dir = "bin";
isExecutable = true;
nativeBuildInputs = [
pkgs.installShellFiles
];
postInstall = ''
installManPage ${args.manPage}
'';
});
nixos-build-vms = makeProg {
name = "nixos-build-vms";
src = ./nixos-build-vms/nixos-build-vms.sh;
inherit (pkgs) runtimeShell;
manPage = ./manpages/nixos-build-vms.8;
};
nixos-install = makeProg {
@ -27,6 +34,7 @@ let
nixos-enter
pkgs.util-linuxMinimal
];
manPage = ./manpages/nixos-install.8;
};
nixos-rebuild = pkgs.nixos-rebuild.override { nix = config.nix.package.out; };
@ -40,6 +48,7 @@ let
btrfs = "${pkgs.btrfs-progs}/bin/btrfs";
inherit (config.system.nixos-generate-config) configuration desktopConfiguration;
xserverEnabled = config.services.xserver.enable;
manPage = ./manpages/nixos-generate-config.8;
};
inherit (pkgs) nixos-option;
@ -57,6 +66,7 @@ let
} // optionalAttrs (config.system.configurationRevision != null) {
configurationRevision = config.system.configurationRevision;
});
manPage = ./manpages/nixos-version.8;
};
nixos-enter = makeProg {
@ -66,6 +76,7 @@ let
path = makeBinPath [
pkgs.util-linuxMinimal
];
manPage = ./manpages/nixos-enter.8;
};
in

View File

@ -346,7 +346,7 @@ in
system.build.manual = manual;
environment.systemPackages = []
++ optional cfg.man.enable manual.manpages
++ optional cfg.man.enable manual.configuration-manual
++ optionals cfg.doc.enable [ manual.manualHTML nixos-help ];
})

View File

@ -143,7 +143,7 @@ in rec {
manualHTML = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manualHTML);
manual = manualHTML; # TODO(@oxij): remove eventually
manualEpub = (buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manualEpub));
manpages = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manpages);
manpages = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.configuration-manual);
options = (buildFromConfig ({ ... }: { }) (config: config.system.build.manual.optionsJSON)).x86_64-linux;

View File

@ -20,8 +20,7 @@ in
inherit (config.system.build)
nixos-install nixos-generate-config nixos-enter;
# Required for --help.
inherit (config.system.build.manual) manpages;
inherit (config.system.build.manual) configuration-manual;
};
extraOutputsToInstall = ["man"];