Merge pull request #102916 from andir/nixos-help
nixos-help: fixup .desktop file & smaller refactoring
This commit is contained in:
commit
ad37c2c445
@ -40,9 +40,9 @@ let
|
|||||||
in scrubbedEval.options;
|
in scrubbedEval.options;
|
||||||
};
|
};
|
||||||
|
|
||||||
helpScript = pkgs.writeScriptBin "nixos-help"
|
|
||||||
''
|
nixos-help = let
|
||||||
#! ${pkgs.runtimeShell} -e
|
helpScript = pkgs.writeShellScriptBin "nixos-help" ''
|
||||||
# Finds first executable browser in a colon-separated list.
|
# Finds first executable browser in a colon-separated list.
|
||||||
# (see how xdg-open defines BROWSER)
|
# (see how xdg-open defines BROWSER)
|
||||||
browser="$(
|
browser="$(
|
||||||
@ -64,10 +64,18 @@ let
|
|||||||
desktopName = "NixOS Manual";
|
desktopName = "NixOS Manual";
|
||||||
genericName = "View NixOS documentation in a web browser";
|
genericName = "View NixOS documentation in a web browser";
|
||||||
icon = "nix-snowflake";
|
icon = "nix-snowflake";
|
||||||
exec = "${helpScript}/bin/nixos-help";
|
exec = "nixos-help";
|
||||||
categories = "System";
|
categories = "System";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
in pkgs.symlinkJoin {
|
||||||
|
name = "nixos-help";
|
||||||
|
paths = [
|
||||||
|
helpScript
|
||||||
|
desktopItem
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -250,8 +258,8 @@ in
|
|||||||
|
|
||||||
environment.systemPackages = []
|
environment.systemPackages = []
|
||||||
++ optional cfg.man.enable manual.manpages
|
++ optional cfg.man.enable manual.manpages
|
||||||
++ optionals cfg.doc.enable ([ manual.manualHTML helpScript ]
|
++ optionals cfg.doc.enable ([ manual.manualHTML nixos-help ]
|
||||||
++ optionals config.services.xserver.enable [ desktopItem pkgs.nixos-icons ]);
|
++ optionals config.services.xserver.enable [ pkgs.nixos-icons ]);
|
||||||
|
|
||||||
services.mingetty.helpLine = mkIf cfg.doc.enable (
|
services.mingetty.helpLine = mkIf cfg.doc.enable (
|
||||||
"\nRun 'nixos-help' for the NixOS manual."
|
"\nRun 'nixos-help' for the NixOS manual."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user