Merge pull request #23861 from benley/nixos-manual-launcher
nixos: Add a menu launcher for the NixOS manual
This commit is contained in:
commit
98e4c5dd45
@ -41,7 +41,7 @@ let
|
|||||||
|
|
||||||
entry = "${manual.manual}/share/doc/nixos/index.html";
|
entry = "${manual.manual}/share/doc/nixos/index.html";
|
||||||
|
|
||||||
help = pkgs.writeScriptBin "nixos-help"
|
helpScript = pkgs.writeScriptBin "nixos-help"
|
||||||
''
|
''
|
||||||
#! ${pkgs.stdenv.shell} -e
|
#! ${pkgs.stdenv.shell} -e
|
||||||
browser="$BROWSER"
|
browser="$BROWSER"
|
||||||
@ -58,6 +58,15 @@ let
|
|||||||
exec "$browser" ${entry}
|
exec "$browser" ${entry}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
desktopItem = pkgs.makeDesktopItem {
|
||||||
|
name = "nixos-manual";
|
||||||
|
desktopName = "NixOS Manual";
|
||||||
|
genericName = "View NixOS documentation in a web browser";
|
||||||
|
# TODO: find a better icon (Nix logo + help overlay?)
|
||||||
|
icon = "system-help";
|
||||||
|
exec = "${helpScript}/bin/nixos-help";
|
||||||
|
categories = "System";
|
||||||
|
};
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -105,7 +114,8 @@ in
|
|||||||
system.build.manual = manual;
|
system.build.manual = manual;
|
||||||
|
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
[ manual.manual help ]
|
[ manual.manual helpScript ]
|
||||||
|
++ optional config.services.xserver.enable desktopItem
|
||||||
++ optional config.programs.man.enable manual.manpages;
|
++ optional config.programs.man.enable manual.manpages;
|
||||||
|
|
||||||
boot.extraTTYs = mkIf cfg.showManual ["tty${toString cfg.ttyNumber}"];
|
boot.extraTTYs = mkIf cfg.showManual ["tty${toString cfg.ttyNumber}"];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user