mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-19 16:09:19 +03:00
nixos-help: bundle the desktop item with the script
This is to ensure that whenever we install the desktop item we also have
the script installed. Prior to b02719a
we always had the reference to
the script in the desktop item. Since desktop items are being copied to
home directories and thus "bit rod" over time that absolute path was
removed.
This commit is contained in:
parent
3560f0d913
commit
9a01e97824
1 changed files with 21 additions and 12 deletions
|
@ -40,8 +40,9 @@ let
|
||||||
in scrubbedEval.options;
|
in scrubbedEval.options;
|
||||||
};
|
};
|
||||||
|
|
||||||
helpScript = pkgs.writeShellScriptBin "nixos-help"
|
|
||||||
''
|
nixos-help = let
|
||||||
|
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="$(
|
||||||
|
@ -58,14 +59,22 @@ let
|
||||||
exec "$browser" ${manual.manualHTMLIndex}
|
exec "$browser" ${manual.manualHTMLIndex}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
desktopItem = pkgs.makeDesktopItem {
|
desktopItem = pkgs.makeDesktopItem {
|
||||||
name = "nixos-manual";
|
name = "nixos-manual";
|
||||||
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 = "nixos-help";
|
exec = "nixos-help";
|
||||||
categories = "System";
|
categories = "System";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
in pkgs.symlinkJoin {
|
||||||
|
name = "nixos-help";
|
||||||
|
paths = [
|
||||||
|
helpScript
|
||||||
|
desktopItem
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
|
@ -249,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…
Add table
Add a link
Reference in a new issue