diff options
author | Doron Behar <doron.behar@gmail.com> | 2023-08-16 15:49:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-16 15:49:49 +0000 |
commit | 62730f2c3107f2f9e4684f05236ea9dc8066568d (patch) | |
tree | 98007894ce5aeadf4290e85485acee1a042792c5 /pkgs/tools/nix | |
parent | af13ed448331981a9deb30c8019c52e0e5cc1233 (diff) | |
parent | 307da96e176c8e7bdb715115806daaa810be4dfc (diff) | |
download | nixlib-62730f2c3107f2f9e4684f05236ea9dc8066568d.tar nixlib-62730f2c3107f2f9e4684f05236ea9dc8066568d.tar.gz nixlib-62730f2c3107f2f9e4684f05236ea9dc8066568d.tar.bz2 nixlib-62730f2c3107f2f9e4684f05236ea9dc8066568d.tar.lz nixlib-62730f2c3107f2f9e4684f05236ea9dc8066568d.tar.xz nixlib-62730f2c3107f2f9e4684f05236ea9dc8066568d.tar.zst nixlib-62730f2c3107f2f9e4684f05236ea9dc8066568d.zip |
Merge pull request #248701 from doronbehar/nixos/manpages
nixos/install-tools: Add manpages to packages instead of seperating them
Diffstat (limited to 'pkgs/tools/nix')
-rw-r--r-- | pkgs/tools/nix/nixos-install-tools/default.nix | 3 | ||||
-rw-r--r-- | pkgs/tools/nix/nixos-option/default.nix | 27 | ||||
-rw-r--r-- | pkgs/tools/nix/nixos-option/nixos-option.8 | 89 |
3 files changed, 113 insertions, 6 deletions
diff --git a/pkgs/tools/nix/nixos-install-tools/default.nix b/pkgs/tools/nix/nixos-install-tools/default.nix index 63f2da0df21c..e0b24a4e70dd 100644 --- a/pkgs/tools/nix/nixos-install-tools/default.nix +++ b/pkgs/tools/nix/nixos-install-tools/default.nix @@ -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) nixos-configuration-reference-manpage; }; extraOutputsToInstall = ["man"]; diff --git a/pkgs/tools/nix/nixos-option/default.nix b/pkgs/tools/nix/nixos-option/default.nix index 56cb3e130038..7cca1eb7b38d 100644 --- a/pkgs/tools/nix/nixos-option/default.nix +++ b/pkgs/tools/nix/nixos-option/default.nix @@ -1,14 +1,33 @@ -{ lib, stdenv, boost, cmake, pkg-config, nix }: +{ lib +, stdenv +, boost +, cmake +, pkg-config +, installShellFiles +, nix +}: stdenv.mkDerivation { name = "nixos-option"; src = ./.; + postInstall = '' + installManPage ${./nixos-option.8} + ''; strictDeps = true; - nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ boost nix ]; - cmakeFlags = [ "-DNIX_DEV_INCLUDEPATH=${nix.dev}/include/nix" ]; + nativeBuildInputs = [ + cmake + pkg-config + installShellFiles + ]; + buildInputs = [ + boost + nix + ]; + cmakeFlags = [ + "-DNIX_DEV_INCLUDEPATH=${nix.dev}/include/nix" + ]; meta = with lib; { license = licenses.lgpl2Plus; diff --git a/pkgs/tools/nix/nixos-option/nixos-option.8 b/pkgs/tools/nix/nixos-option/nixos-option.8 new file mode 100644 index 000000000000..28438b03580b --- /dev/null +++ b/pkgs/tools/nix/nixos-option/nixos-option.8 @@ -0,0 +1,89 @@ +.Dd January 1, 1980 +.Dt nixos-option 8 +.Os +.Sh NAME +.Nm nixos-option +.Nd inspect a NixOS configuration +. +. +. +.Sh SYNOPSIS +.Nm +.Op Fl r | -recursive +.Op Fl I Ar path +.Ar option.name +. +. +. +.Sh DESCRIPTION +This command evaluates the configuration specified in +.Pa /etc/nixos/configuration.nix +and returns the properties of the option name given as argument. +. +.Pp +When the option name is not an option, the command prints the list of attributes +contained in the attribute set. +. +. +. +.Sh OPTIONS +.Bl -tag -width indent +.It Fl r , -recursive +Print all the values at or below the specified path recursively. +. +.It Fl I Ar path +This option is passed to the underlying +.Xr nix-instantiate 1 +invocation. +.El +. +. +. +.Sh ENVIRONMENT +.Bl -tag -width indent +.It Ev NIXOS_CONFIG +Path to the main NixOS configuration module. Defaults to +.Pa /etc/nixos/configuration.nix Ns +\&. +.El +. +. +. +.Sh EXAMPLES +Investigate option values: +.Bd -literal -offset indent +$ nixos-option boot.loader +This attribute set contains: +generationsDir +grub +initScript + +$ nixos-option boot.loader.grub.enable +Value: +true + +Default: +true + +Description: +Whether to enable the GNU GRUB boot loader. + +Declared by: + "/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/loader/grub/grub.nix" + +Defined by: + "/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/loader/grub/grub.nix" +.Ed +. +. +. +.Sh SEE ALSO +.Xr configuration.nix 5 +. +. +. +.Sh AUTHORS +.An -nosplit +.An Nicolas Pierron +and +.An the Nixpkgs/NixOS contributors |