···185 */
186 makeBinPath = makeSearchPathOutput "bin" "bin";
1870000000000188 /* Depending on the boolean `cond', return either the given string
189 or the empty string. Useful to concatenate against a bigger string.
190···294 map f (stringToCharacters s)
295 );
296000000000000000297 /* Escape occurrence of the elements of `list` in `string` by
298 prefixing it with a backslash.
299···304 => "\\(foo\\)"
305 */
306 escape = list: replaceChars list (map (c: "\\${c}") list);
0000000000000307308 /* Quote string to be used safely within the Bourne shell.
309
···185 */
186 makeBinPath = makeSearchPathOutput "bin" "bin";
187188+ /* Normalize path, removing extranous /s
189+190+ Type: normalizePath :: string -> string
191+192+ Example:
193+ normalizePath "/a//b///c/"
194+ => "/a/b/c/"
195+ */
196+ normalizePath = s: (builtins.foldl' (x: y: if y == "/" && hasSuffix "/" x then x else x+y) "" (splitString "" s));
197+198 /* Depending on the boolean `cond', return either the given string
199 or the empty string. Useful to concatenate against a bigger string.
200···304 map f (stringToCharacters s)
305 );
306307+ /* Convert char to ascii value, must be in printable range
308+309+ Type: charToInt :: string -> int
310+311+ Example:
312+ charToInt "A"
313+ => 65
314+ charToInt "("
315+ => 40
316+317+ */
318+ charToInt = let
319+ table = import ./ascii-table.nix;
320+ in c: builtins.getAttr c table;
321+322 /* Escape occurrence of the elements of `list` in `string` by
323 prefixing it with a backslash.
324···329 => "\\(foo\\)"
330 */
331 escape = list: replaceChars list (map (c: "\\${c}") list);
332+333+ /* Escape occurence of the element of `list` in `string` by
334+ converting to its ASCII value and prefixing it with \\x.
335+ Only works for printable ascii characters.
336+337+ Type: escapeC = [string] -> string -> string
338+339+ Example:
340+ escapeC [" "] "foo bar"
341+ => "foo\\x20bar"
342+343+ */
344+ escapeC = list: replaceChars list (map (c: "\\x${ toLower (lib.toHexString (charToInt c))}") list);
345346 /* Quote string to be used safely within the Bourne shell.
347
···311 </listitem>
312 <listitem>
313 <para>
0000000314 <link xlink:href="https://git.sr.ht/~migadu/alps">alps</link>,
315 a simple and extensible webmail. Available as
316 <link linkend="opt-services.alps.enable">services.alps</link>.
···311 </listitem>
312 <listitem>
313 <para>
314+ <link xlink:href="https://ntfy.sh">ntfy.sh</link>, a push
315+ notification service. Available as
316+ <link linkend="opt-services.ntfy-sh.enable">services.ntfy-sh</link>
317+ </para>
318+ </listitem>
319+ <listitem>
320+ <para>
321 <link xlink:href="https://git.sr.ht/~migadu/alps">alps</link>,
322 a simple and extensible webmail. Available as
323 <link linkend="opt-services.alps.enable">services.alps</link>.
+2
nixos/doc/manual/release-notes/rl-2211.section.md
···112113- [Outline](https://www.getoutline.com/), a wiki and knowledge base similar to Notion. Available as [services.outline](#opt-services.outline.enable).
11400115- [alps](https://git.sr.ht/~migadu/alps), a simple and extensible webmail. Available as [services.alps](#opt-services.alps.enable).
116117- [endlessh-go](https://github.com/shizunge/endlessh-go), an SSH tarpit that exposes Prometheus metrics. Available as [services.endlessh-go](#opt-services.endlessh-go.enable).
···112113- [Outline](https://www.getoutline.com/), a wiki and knowledge base similar to Notion. Available as [services.outline](#opt-services.outline.enable).
114115+- [ntfy.sh](https://ntfy.sh), a push notification service. Available as [services.ntfy-sh](#opt-services.ntfy-sh.enable)
116+117- [alps](https://git.sr.ht/~migadu/alps), a simple and extensible webmail. Available as [services.alps](#opt-services.alps.enable).
118119- [endlessh-go](https://github.com/shizunge/endlessh-go), an SSH tarpit that exposes Prometheus metrics. Available as [services.endlessh-go](#opt-services.endlessh-go.enable).
+13-5
nixos/lib/utils.nix
···39 || hasPrefix a'.mountPoint b'.mountPoint
40 || any (hasPrefix a'.mountPoint) b'.depends;
4142- # Escape a path according to the systemd rules, e.g. /dev/xyzzy
43- # becomes dev-xyzzy. FIXME: slow.
44- escapeSystemdPath = s:
45- replaceChars ["/" "-" " "] ["-" "\\x2d" "\\x20"]
46- (removePrefix "/" s);
000000004748 # Quotes an argument for use in Exec* service lines.
49 # systemd accepts "-quoted strings with escape sequences, toJSON produces
···39 || hasPrefix a'.mountPoint b'.mountPoint
40 || any (hasPrefix a'.mountPoint) b'.depends;
4142+ # Escape a path according to the systemd rules. FIXME: slow
43+ # The rules are described in systemd.unit(5) as follows:
44+ # The escaping algorithm operates as follows: given a string, any "/" character is replaced by "-", and all other characters which are not ASCII alphanumerics, ":", "_" or "." are replaced by C-style "\x2d" escapes. In addition, "." is replaced with such a C-style escape when it would appear as the first character in the escaped string.
45+ # When the input qualifies as absolute file system path, this algorithm is extended slightly: the path to the root directory "/" is encoded as single dash "-". In addition, any leading, trailing or duplicate "/" characters are removed from the string before transformation. Example: /foo//bar/baz/ becomes "foo-bar-baz".
46+ escapeSystemdPath = s: let
47+ replacePrefix = p: r: s: (if (hasPrefix p s) then r + (removePrefix p s) else s);
48+ trim = s: removeSuffix "/" (removePrefix "/" s);
49+ normalizedPath = strings.normalizePath s;
50+ in
51+ replaceChars ["/"] ["-"]
52+ (replacePrefix "." (strings.escapeC ["."] ".")
53+ (strings.escapeC (stringToCharacters " !\"#$%&'()*+,;<=>=@[\\]^`{|}~-")
54+ (if normalizedPath == "/" then normalizedPath else trim normalizedPath)));
5556 # Quotes an argument for use in Exec* service lines.
57 # systemd accepts "-quoted strings with escape sequences, toJSON produces
···24 # Add all supported builds as attributes
25 allBuilds = mapAttrs' (version: file: nameValuePair (computeName version) (buildTensorRTPackage (removeAttrs file ["fileVersionCuda"]))) supportedVersions;
26 # Set the default attributes, e.g. tensorrt = tensorrt_8_4;
27- defaultBuild = { "tensorrt" = allBuilds.${computeName tensorRTDefaultVersion}; };
0028 in allBuilds // defaultBuild;
2930 tensorRTVersions = {
···24 # Add all supported builds as attributes
25 allBuilds = mapAttrs' (version: file: nameValuePair (computeName version) (buildTensorRTPackage (removeAttrs file ["fileVersionCuda"]))) supportedVersions;
26 # Set the default attributes, e.g. tensorrt = tensorrt_8_4;
27+ defaultBuild = { "tensorrt" = if allBuilds ? ${computeName tensorRTDefaultVersion}
28+ then allBuilds.${computeName tensorRTDefaultVersion}
29+ else throw "tensorrt-${tensorRTDefaultVersion} does not support your cuda version ${cudaVersion}"; };
30 in allBuilds // defaultBuild;
3132 tensorRTVersions = {
···11 "11.4" = "082dkk5y34wyvjgj2p5j1d00rk8xaxb9z0mhvz16bd469r1bw2qk";
12 "11.5" = "sha256-AKRZbke0K59lakhTi8dX2cR2aBuWPZkiQxyKaZTvHrI=";
13 "11.6" = "sha256-AsLNmAplfuQbXg9zt09tXAuFJ524EtTYsQuUlV1tPkE=";
14- # the tag 11.7 does not exists: see https://github.com/NVIDIA/cuda-samples/issues/128
15 # maybe fixed by https://github.com/NVIDIA/cuda-samples/pull/133
16- "11.7" = throw "The tag 11.7 of cuda-samples does not exists (see see https://github.com/NVIDIA/cuda-samples/issues/128)";
017 }.${prev.cudaVersion};
1819in {
···11 "11.4" = "082dkk5y34wyvjgj2p5j1d00rk8xaxb9z0mhvz16bd469r1bw2qk";
12 "11.5" = "sha256-AKRZbke0K59lakhTi8dX2cR2aBuWPZkiQxyKaZTvHrI=";
13 "11.6" = "sha256-AsLNmAplfuQbXg9zt09tXAuFJ524EtTYsQuUlV1tPkE=";
014 # maybe fixed by https://github.com/NVIDIA/cuda-samples/pull/133
15+ "11.7" = throw "The tag 11.7 of cuda-samples does not exist";
16+ "11.8" = throw "The tag 11.8 of cuda-samples does not exist";
17 }.${prev.cudaVersion};
1819in {
+2-2
pkgs/tools/admin/credhub-cli/default.nix
···23buildGoModule rec {
4 pname = "credhub-cli";
5- version = "2.9.5";
67 src = fetchFromGitHub {
8 owner = "cloudfoundry-incubator";
9 repo = "credhub-cli";
10 rev = version;
11- sha256 = "sha256-M2FIzLl1pQ/TJinG4UOh2VQWfZx4iT3Qw6pJhjv88cM=";
12 };
1314 # these tests require network access that we're not going to give them
···23buildGoModule rec {
4 pname = "credhub-cli";
5+ version = "2.9.6";
67 src = fetchFromGitHub {
8 owner = "cloudfoundry-incubator";
9 repo = "credhub-cli";
10 rev = version;
11+ sha256 = "sha256-g7LJlMKwV3Cq0LEBPWPgzPJAp9W6bwVuuVVv/ZhuBSM=";
12 };
1314 # these tests require network access that we're not going to give them
···35 --replace "= gcc" "=${stdenv.cc.targetPrefix}cc" \
36 --replace "= g++" "=${stdenv.cc.targetPrefix}c++" \
37 --replace "-DGNU_RUNTIME=1" "" \
38- --replace "-fgnu-runtime" "-fobjc-nonfragile-abi"
39 done
4041 # we need to build inside this directory as well, so we have to make it writeable
···35 --replace "= gcc" "=${stdenv.cc.targetPrefix}cc" \
36 --replace "= g++" "=${stdenv.cc.targetPrefix}c++" \
37 --replace "-DGNU_RUNTIME=1" "" \
38+ --replace "-fgnu-runtime" "-fobjc-runtime=gnustep-2.0"
39 done
4041 # we need to build inside this directory as well, so we have to make it writeable
+3-3
pkgs/tools/filesystems/lfs/default.nix
···56rustPlatform.buildRustPackage rec {
7 pname = "lfs";
8- version = "2.5.0";
910 src = fetchFromGitHub {
11 owner = "Canop";
12 repo = pname;
13 rev = "v${version}";
14- sha256 = "sha256-7dSBac+rLedgko4KLVS9ZWrj/IlXJMsnbQFzyQxv4LQ=";
15 };
1617- cargoSha256 = "sha256-stDxDBftIVZqgy49VGJHx+JTzflVE91QN75aSWhvgSs=";
1819 meta = with lib; {
20 description = "Get information on your mounted disks";
···56rustPlatform.buildRustPackage rec {
7 pname = "lfs";
8+ version = "2.6.0";
910 src = fetchFromGitHub {
11 owner = "Canop";
12 repo = pname;
13 rev = "v${version}";
14+ sha256 = "sha256-+BkHE4vl1oYNR5SX2y7Goly7OwGDXRoZex6YL7Xv2QI=";
15 };
1617+ cargoSha256 = "sha256-njrjuLHDmcubw8lLPpS9K5la0gRIKq4OrP+MXs1Ro/o=";
1819 meta = with lib; {
20 description = "Get information on your mounted disks";