git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit9a01e978244c2d7e20b97533309f02ba93933a8c authorAndreas Rammhold <andreas@rammhold.de> dateThu 5 Nov 2020, 11:51 (6 years ago) parent3560f0d
1 file changed+21−12
nixos/modules/misc/documentation.nix+21−12
nixos/modules/misc/documentation.nix+21−12
@@ -40,8 +40,9 @@ let
4040 in scrubbedEval.options;
4141 };
4242
43− helpScript = pkgs.writeShellScriptBin "nixos-help"
44− ''
43+
44+ nixos-help = let
45+ helpScript = pkgs.writeShellScriptBin "nixos-help" ''
4546 # Finds first executable browser in a colon-separated list.
4647 # (see how xdg-open defines BROWSER)
4748 browser="$(
@@ -58,14 +59,22 @@ let
5859 exec "$browser" ${manual.manualHTMLIndex}
5960 '';
6061
61− desktopItem = pkgs.makeDesktopItem {
62− name = "nixos-manual";
63− desktopName = "NixOS Manual";
64− genericName = "View NixOS documentation in a web browser";
65− icon = "nix-snowflake";
66− exec = "nixos-help";
67− categories = "System";
68− };
62+ desktopItem = pkgs.makeDesktopItem {
63+ name = "nixos-manual";
64+ desktopName = "NixOS Manual";
65+ genericName = "View NixOS documentation in a web browser";
66+ icon = "nix-snowflake";
67+ exec = "nixos-help";
68+ categories = "System";
69+ };
70+
71+ in pkgs.symlinkJoin {
72+ name = "nixos-help";
73+ paths = [
74+ helpScript
75+ desktopItem
76+ ];
77+ };
6978
7079in
7180
@@ -249,8 +258,8 @@ in
249258
250259 environment.systemPackages = []
251260 ++ optional cfg.man.enable manual.manpages
252− ++ optionals cfg.doc.enable ([ manual.manualHTML helpScript ]
253− ++ optionals config.services.xserver.enable [ desktopItem pkgs.nixos-icons ]);
261+ ++ optionals cfg.doc.enable ([ manual.manualHTML nixos-help ]
262+ ++ optionals config.services.xserver.enable [ pkgs.nixos-icons ]);
254263
255264 services.mingetty.helpLine = mkIf cfg.doc.enable (
256265 "\nRun 'nixos-help' for the NixOS manual."