From 2a84b7e1293281c5c5543a6eca40cca555b060f6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 21 Jul 2024 16:22:12 +0800 Subject: [PATCH] wrapper-manager-fds/modules: update module descriptions and disable escaping `pathAdd` `makeWrapperBinary` already escapes it so it would be problematic. --- .../modules/wrapper-manager/base.nix | 17 +++++++++++------ .../wrapper-manager/xdg-desktop-entries.nix | 6 ++++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index b5b851b3..a1ba1793 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -93,9 +93,13 @@ let preScript = lib.mkOption { type = lib.types.lines; description = '' - Script fragments to run before the main executable. This option is only - used when the wrapper script is not compiled into a binary (that is, - when {option}`build.isBinary` is set to `false`). + Script fragments to run before the main executable. + + ::: {.note} + This option is only used when the wrapper script is not compiled + into a binary (that is, when {option}`build.isBinary` is set to + `false`). + ::: ''; default = ""; example = lib.literalExpression '' @@ -106,7 +110,8 @@ let makeWrapperArgs = lib.mkOption { type = with lib.types; listOf str; description = '' - A list of extra arguments to be passed as part of makeWrapper. + A list of extra arguments to be passed as part of `makeWrapper` + build step. ''; example = [ "--inherit-argv0" ]; }; @@ -118,7 +123,7 @@ let ] ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) ++ (builtins.map (v: "--unset ${v}") config.unset) - ++ (builtins.map (v: "--prefix 'PATH' ':' ${lib.escapeShellArg v}") config.pathAdd) + ++ (builtins.map (v: "--prefix 'PATH' ':' ${v}") config.pathAdd) ++ (builtins.map (v: "--add-flags ${v}") config.prependArgs) ++ (builtins.map (v: "--append-flags ${v}") config.appendArgs) ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( @@ -156,7 +161,7 @@ in description = '' A list of packages to be included in the wrapper package. - ::: {note} + ::: {.note} This can override some of the binaries included in this list which is typically intended to be used as a wrapped package. ::: diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix index d1d946fb..8461663f 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-desktop-entries.nix @@ -17,7 +17,7 @@ let desktopName = lib.mkOption { type = lib.types.nonEmptyStr; - description = "Specific name of the application"; + description = "Specific name of the application."; default = name; example = "Firefox"; }; @@ -31,7 +31,7 @@ let genericName = lib.mkOption { type = with lib.types; nullOr nonEmptyStr; - description = "Generic name of the application"; + description = "Generic name of the application."; default = null; example = "Web browser"; }; @@ -64,6 +64,8 @@ in type = with lib.types; attrsOf (submodule xdgDesktopEntry); description = '' A set of desktop entries to be exported along with the wrapped package. + The attribute name will be used as the filename of the generated desktop + entry file. ''; default = { }; example = lib.literalExpression ''