···185185 */
186186 makeBinPath = makeSearchPathOutput "bin" "bin";
187187188188+ /* Normalize path, removing extranous /s
189189+190190+ Type: normalizePath :: string -> string
191191+192192+ Example:
193193+ normalizePath "/a//b///c/"
194194+ => "/a/b/c/"
195195+ */
196196+ normalizePath = s: (builtins.foldl' (x: y: if y == "/" && hasSuffix "/" x then x else x+y) "" (splitString "" s));
197197+188198 /* Depending on the boolean `cond', return either the given string
189199 or the empty string. Useful to concatenate against a bigger string.
190200···294304 map f (stringToCharacters s)
295305 );
296306307307+ /* Convert char to ascii value, must be in printable range
308308+309309+ Type: charToInt :: string -> int
310310+311311+ Example:
312312+ charToInt "A"
313313+ => 65
314314+ charToInt "("
315315+ => 40
316316+317317+ */
318318+ charToInt = let
319319+ table = import ./ascii-table.nix;
320320+ in c: builtins.getAttr c table;
321321+297322 /* Escape occurrence of the elements of `list` in `string` by
298323 prefixing it with a backslash.
299324···304329 => "\\(foo\\)"
305330 */
306331 escape = list: replaceChars list (map (c: "\\${c}") list);
332332+333333+ /* Escape occurence of the element of `list` in `string` by
334334+ converting to its ASCII value and prefixing it with \\x.
335335+ Only works for printable ascii characters.
336336+337337+ Type: escapeC = [string] -> string -> string
338338+339339+ Example:
340340+ escapeC [" "] "foo bar"
341341+ => "foo\\x20bar"
342342+343343+ */
344344+ escapeC = list: replaceChars list (map (c: "\\x${ toLower (lib.toHexString (charToInt c))}") list);
307345308346 /* Quote string to be used safely within the Bourne shell.
309347
···311311 </listitem>
312312 <listitem>
313313 <para>
314314+ <link xlink:href="https://ntfy.sh">ntfy.sh</link>, a push
315315+ notification service. Available as
316316+ <link linkend="opt-services.ntfy-sh.enable">services.ntfy-sh</link>
317317+ </para>
318318+ </listitem>
319319+ <listitem>
320320+ <para>
314321 <link xlink:href="https://git.sr.ht/~migadu/alps">alps</link>,
315322 a simple and extensible webmail. Available as
316323 <link linkend="opt-services.alps.enable">services.alps</link>.
+2
nixos/doc/manual/release-notes/rl-2211.section.md
···112112113113- [Outline](https://www.getoutline.com/), a wiki and knowledge base similar to Notion. Available as [services.outline](#opt-services.outline.enable).
114114115115+- [ntfy.sh](https://ntfy.sh), a push notification service. Available as [services.ntfy-sh](#opt-services.ntfy-sh.enable)
116116+115117- [alps](https://git.sr.ht/~migadu/alps), a simple and extensible webmail. Available as [services.alps](#opt-services.alps.enable).
116118117119- [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
···3939 || hasPrefix a'.mountPoint b'.mountPoint
4040 || any (hasPrefix a'.mountPoint) b'.depends;
41414242- # Escape a path according to the systemd rules, e.g. /dev/xyzzy
4343- # becomes dev-xyzzy. FIXME: slow.
4444- escapeSystemdPath = s:
4545- replaceChars ["/" "-" " "] ["-" "\\x2d" "\\x20"]
4646- (removePrefix "/" s);
4242+ # Escape a path according to the systemd rules. FIXME: slow
4343+ # The rules are described in systemd.unit(5) as follows:
4444+ # 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.
4545+ # 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".
4646+ escapeSystemdPath = s: let
4747+ replacePrefix = p: r: s: (if (hasPrefix p s) then r + (removePrefix p s) else s);
4848+ trim = s: removeSuffix "/" (removePrefix "/" s);
4949+ normalizedPath = strings.normalizePath s;
5050+ in
5151+ replaceChars ["/"] ["-"]
5252+ (replacePrefix "." (strings.escapeC ["."] ".")
5353+ (strings.escapeC (stringToCharacters " !\"#$%&'()*+,;<=>=@[\\]^`{|}~-")
5454+ (if normalizedPath == "/" then normalizedPath else trim normalizedPath)));
47554856 # Quotes an argument for use in Exec* service lines.
4957 # systemd accepts "-quoted strings with escape sequences, toJSON produces
···1111 "11.4" = "082dkk5y34wyvjgj2p5j1d00rk8xaxb9z0mhvz16bd469r1bw2qk";
1212 "11.5" = "sha256-AKRZbke0K59lakhTi8dX2cR2aBuWPZkiQxyKaZTvHrI=";
1313 "11.6" = "sha256-AsLNmAplfuQbXg9zt09tXAuFJ524EtTYsQuUlV1tPkE=";
1414- # the tag 11.7 does not exists: see https://github.com/NVIDIA/cuda-samples/issues/128
1514 # maybe fixed by https://github.com/NVIDIA/cuda-samples/pull/133
1616- "11.7" = throw "The tag 11.7 of cuda-samples does not exists (see see https://github.com/NVIDIA/cuda-samples/issues/128)";
1515+ "11.7" = throw "The tag 11.7 of cuda-samples does not exist";
1616+ "11.8" = throw "The tag 11.8 of cuda-samples does not exist";
1717 }.${prev.cudaVersion};
18181919in {
+2-2
pkgs/tools/admin/credhub-cli/default.nix
···2233buildGoModule rec {
44 pname = "credhub-cli";
55- version = "2.9.5";
55+ version = "2.9.6";
6677 src = fetchFromGitHub {
88 owner = "cloudfoundry-incubator";
99 repo = "credhub-cli";
1010 rev = version;
1111- sha256 = "sha256-M2FIzLl1pQ/TJinG4UOh2VQWfZx4iT3Qw6pJhjv88cM=";
1111+ sha256 = "sha256-g7LJlMKwV3Cq0LEBPWPgzPJAp9W6bwVuuVVv/ZhuBSM=";
1212 };
13131414 # these tests require network access that we're not going to give them
···3535 --replace "= gcc" "=${stdenv.cc.targetPrefix}cc" \
3636 --replace "= g++" "=${stdenv.cc.targetPrefix}c++" \
3737 --replace "-DGNU_RUNTIME=1" "" \
3838- --replace "-fgnu-runtime" "-fobjc-nonfragile-abi"
3838+ --replace "-fgnu-runtime" "-fobjc-runtime=gnustep-2.0"
3939 done
40404141 # we need to build inside this directory as well, so we have to make it writeable
+3-3
pkgs/tools/filesystems/lfs/default.nix
···5566rustPlatform.buildRustPackage rec {
77 pname = "lfs";
88- version = "2.5.0";
88+ version = "2.6.0";
991010 src = fetchFromGitHub {
1111 owner = "Canop";
1212 repo = pname;
1313 rev = "v${version}";
1414- sha256 = "sha256-7dSBac+rLedgko4KLVS9ZWrj/IlXJMsnbQFzyQxv4LQ=";
1414+ sha256 = "sha256-+BkHE4vl1oYNR5SX2y7Goly7OwGDXRoZex6YL7Xv2QI=";
1515 };
16161717- cargoSha256 = "sha256-stDxDBftIVZqgy49VGJHx+JTzflVE91QN75aSWhvgSs=";
1717+ cargoSha256 = "sha256-njrjuLHDmcubw8lLPpS9K5la0gRIKq4OrP+MXs1Ro/o=";
18181919 meta = with lib; {
2020 description = "Get information on your mounted disks";