Skip to content

Commit

Permalink
nixos: Add a menu launcher for the NixOS manual
Browse files Browse the repository at this point in the history
(cherry picked from commit 638e1b8)
  • Loading branch information
benley committed Mar 15, 2017
1 parent 073a8e8 commit b1b4653
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions nixos/modules/services/misc/nixos-manual.nix
Expand Up @@ -41,7 +41,7 @@ let

entry = "${manual.manual}/share/doc/nixos/index.html";

help = pkgs.writeScriptBin "nixos-help"
helpScript = pkgs.writeScriptBin "nixos-help"
''
#! ${pkgs.stdenv.shell} -e
browser="$BROWSER"
Expand All @@ -58,6 +58,15 @@ let
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

{
Expand Down Expand Up @@ -105,7 +114,8 @@ in
system.build.manual = manual;

environment.systemPackages =
[ manual.manual help ]
[ manual.manual helpScript ]
++ optional config.services.xserver.enable desktopItem
++ optional config.programs.man.enable manual.manpages;

boot.extraTTYs = mkIf cfg.showManual ["tty${toString cfg.ttyNumber}"];
Expand Down

0 comments on commit b1b4653

Please sign in to comment.