lib.replaceChars: warn about being a deprecated alias

replaceStrings has been in nix since 2015(nix 1.10)

so it is safe to remove the fallback

https://github.com/nixos/nix/commit/d6d5885c1567454754a0d260521bafa0bd5e7fdb

Artturin 05a2dfd6 084fd690

Changed files
+64 -75
lib
nixos
lib
modules
config
programs
services
system
boot
loader
grub
tasks
tests
pkgs
applications
audio
editors
jetbrains
emulators
atari800
desmume
retroarch
misc
sweethome3d
science
math
misc
openmodelica
omlibrary
build-support
fetchmavenartifact
rust
build-rust-crate
development
compilers
interpreters
gauche
libraries
icu
java
hsqldb
muparser
opendkim
opensubdiv
mobile
androidenv
titaniumenv
xcodeenv
python-modules
scikit-learn
tools
haskell
lambdabot
misc
segger-ozone
web
games
nexuiz
terraria-server
servers
invidious
tools
typesetting
tex
pgf-tikz
top-level
+6 -17
lib/strings.nix
···
escape ["(" ")"] "(foo)"
=> "\\(foo\\)"
*/
-
escape = list: replaceChars list (map (c: "\\${c}") list);
+
escape = list: replaceStrings list (map (c: "\\${c}") list);
/* Escape occurence of the element of `list` in `string` by
converting to its ASCII value and prefixing it with \\x.
···
=> "foo\\x20bar"
*/
-
escapeC = list: replaceChars list (map (c: "\\x${ toLower (lib.toHexString (charToInt c))}") list);
+
escapeC = list: replaceStrings list (map (c: "\\x${ toLower (lib.toHexString (charToInt c))}") list);
/* Quote string to be used safely within the Bourne shell.
···
["\"" "'" "<" ">" "&"]
["&quot;" "&apos;" "&lt;" "&gt;" "&amp;"];
-
# Obsolete - use replaceStrings instead.
-
replaceChars = builtins.replaceStrings or (
-
del: new: s:
-
let
-
substList = lib.zipLists del new;
-
subst = c:
-
let found = lib.findFirst (sub: sub.fst == c) null substList; in
-
if found == null then
-
c
-
else
-
found.snd;
-
in
-
stringAsChars subst s);
+
# warning added 12-12-2022
+
replaceChars = lib.warn "replaceChars is a deprecated alias of replaceStrings, replace usages of it with replaceStrings." builtins.replaceStrings;
# Case conversion utilities.
lowerChars = stringToCharacters "abcdefghijklmnopqrstuvwxyz";
···
toLower "HOME"
=> "home"
*/
-
toLower = replaceChars upperChars lowerChars;
+
toLower = replaceStrings upperChars lowerChars;
/* Converts an ASCII string to upper-case.
···
toUpper "home"
=> "HOME"
*/
-
toUpper = replaceChars lowerChars upperChars;
+
toUpper = replaceStrings lowerChars upperChars;
/* Appends string context from another string. This is an implementation
detail of Nix and should be used carefully.
+3 -3
nixos/lib/systemd-lib.nix
···
systemd = cfg.package;
in rec {
-
shellEscape = s: (replaceChars [ "\\" ] [ "\\\\" ] s);
+
shellEscape = s: (replaceStrings [ "\\" ] [ "\\\\" ] s);
-
mkPathSafeName = lib.replaceChars ["@" ":" "\\" "[" "]"] ["-" "-" "-" "" ""];
+
mkPathSafeName = lib.replaceStrings ["@" ":" "\\" "[" "]"] ["-" "-" "-" "" ""];
# a type for options that take a unit name
unitNameType = types.strMatching "[a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)";
···
makeJobScript = name: text:
let
-
scriptName = replaceChars [ "\\" "@" ] [ "-" "_" ] (shellEscape name);
+
scriptName = replaceStrings [ "\\" "@" ] [ "-" "_" ] (shellEscape name);
out = (pkgs.writeShellScriptBin scriptName ''
set -e
${text}
+3 -3
nixos/lib/utils.nix
···
trim = s: removeSuffix "/" (removePrefix "/" s);
normalizedPath = strings.normalizePath s;
in
-
replaceChars ["/"] ["-"]
+
replaceStrings ["/"] ["-"]
(replacePrefix "." (strings.escapeC ["."] ".")
(strings.escapeC (stringToCharacters " !\"#$%&'()*+,;<=>=@[\\]^`{|}~-")
(if normalizedPath == "/" then normalizedPath else trim normalizedPath)));
···
else if builtins.isInt arg || builtins.isFloat arg then toString arg
else throw "escapeSystemdExecArg only allows strings, paths and numbers";
in
-
replaceChars [ "%" "$" ] [ "%%" "$$" ] (builtins.toJSON s);
+
replaceStrings [ "%" "$" ] [ "%%" "$$" ] (builtins.toJSON s);
# Quotes a list of arguments into a single string for use in a Exec*
# line.
···
else if isAttrs item then
map (name:
let
-
escapedName = ''"${replaceChars [''"'' "\\"] [''\"'' "\\\\"] name}"'';
+
escapedName = ''"${replaceStrings [''"'' "\\"] [''\"'' "\\\\"] name}"'';
in
recurse (prefix + "." + escapedName) item.${name}) (attrNames item)
else if isList item then
+1 -1
nixos/modules/config/swap.nix
···
config = rec {
device = mkIf options.label.isDefined
"/dev/disk/by-label/${config.label}";
-
deviceName = lib.replaceChars ["\\"] [""] (escapeSystemdPath config.device);
+
deviceName = lib.replaceStrings ["\\"] [""] (escapeSystemdPath config.device);
realDevice = if config.randomEncryption.enable then "/dev/mapper/${deviceName}" else config.device;
};
+1 -1
nixos/modules/programs/xfs_quota.nix
···
'';
wantedBy = [ "multi-user.target" ];
-
after = [ ((replaceChars [ "/" ] [ "-" ] opts.fileSystem) + ".mount") ];
+
after = [ ((replaceStrings [ "/" ] [ "-" ] opts.fileSystem) + ".mount") ];
restartTriggers = [ config.environment.etc.projects.source ];
+1 -1
nixos/modules/services/mail/listmonk.nix
···
# Escaping is done according to https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS
setDatabaseOption = key: value:
"UPDATE settings SET value = '${
-
lib.replaceChars [ "'" ] [ "''" ] (builtins.toJSON value)
+
lib.replaceStrings [ "'" ] [ "''" ] (builtins.toJSON value)
}' WHERE key = '${key}';";
updateDatabaseConfigSQL = pkgs.writeText "update-database-config.sql"
(concatStringsSep "\n" (mapAttrsToList setDatabaseOption
+3 -3
nixos/modules/services/networking/supplicant.nix
···
serviceName = iface: "supplicant-${if (iface=="WLAN") then "wlan@" else (
if (iface=="LAN") then "lan@" else (
if (iface=="DBUS") then "dbus"
-
else (replaceChars [" "] ["-"] iface)))}";
+
else (replaceStrings [" "] ["-"] iface)))}";
# TODO: Use proper privilege separation for wpa_supplicant
supplicantService = iface: suppl:
···
driverArg = optionalString (suppl.driver != null) "-D${suppl.driver}";
bridgeArg = optionalString (suppl.bridge!="") "-b${suppl.bridge}";
confFileArg = optionalString (suppl.configFile.path!=null) "-c${suppl.configFile.path}";
-
extraConfFile = pkgs.writeText "supplicant-extra-conf-${replaceChars [" "] ["-"] iface}" ''
+
extraConfFile = pkgs.writeText "supplicant-extra-conf-${replaceStrings [" "] ["-"] iface}" ''
${optionalString suppl.userControlled.enable "ctrl_interface=DIR=${suppl.userControlled.socketDir} GROUP=${suppl.userControlled.group}"}
${optionalString suppl.configFile.writable "update_config=1"}
${suppl.extraConf}
···
text = ''
${flip (concatMapStringsSep "\n") (filter (n: n!="WLAN" && n!="LAN" && n!="DBUS") (attrNames cfg)) (iface:
flip (concatMapStringsSep "\n") (splitString " " iface) (i: ''
-
ACTION=="add", SUBSYSTEM=="net", ENV{INTERFACE}=="${i}", TAG+="systemd", ENV{SYSTEMD_WANTS}+="supplicant-${replaceChars [" "] ["-"] iface}.service", TAG+="SUPPLICANT_ASSIGNED"''))}
+
ACTION=="add", SUBSYSTEM=="net", ENV{INTERFACE}=="${i}", TAG+="systemd", ENV{SYSTEMD_WANTS}+="supplicant-${replaceStrings [" "] ["-"] iface}.service", TAG+="SUPPLICANT_ASSIGNED"''))}
${optionalString (hasAttr "WLAN" cfg) ''
ACTION=="add", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", TAG!="SUPPLICANT_ASSIGNED", TAG+="systemd", PROGRAM="/run/current-system/systemd/bin/systemd-escape -p %E{INTERFACE}", ENV{SYSTEMD_WANTS}+="supplicant-wlan@$result.service"
+1 -1
nixos/modules/services/networking/wireguard.nix
···
peerUnitServiceName = interfaceName: publicKey: dynamicRefreshEnabled:
let
-
keyToUnitName = replaceChars
+
keyToUnitName = replaceStrings
[ "/" "-" " " "+" "=" ]
[ "-" "\\x2d" "\\x20" "\\x2b" "\\x3d" ];
unitName = keyToUnitName publicKey;
+1 -1
nixos/modules/system/boot/loader/grub/grub.nix
···
grubConfig = args:
let
efiSysMountPoint = if args.efiSysMountPoint == null then args.path else args.efiSysMountPoint;
-
efiSysMountPoint' = replaceChars [ "/" ] [ "-" ] efiSysMountPoint;
+
efiSysMountPoint' = replaceStrings [ "/" ] [ "-" ] efiSysMountPoint;
in
pkgs.writeText "grub-config.xml" (builtins.toXML
{ splashImage = f cfg.splashImage;
+3 -3
nixos/modules/tasks/network-interfaces.nix
···
# networkmanager falls back to "/proc/sys/net/ipv6/conf/default/use_tempaddr"
"net.ipv6.conf.default.use_tempaddr" = tempaddrValues.${cfg.tempAddresses}.sysctl;
} // listToAttrs (forEach interfaces
-
(i: nameValuePair "net.ipv4.conf.${replaceChars ["."] ["/"] i.name}.proxy_arp" i.proxyARP))
+
(i: nameValuePair "net.ipv4.conf.${replaceStrings ["."] ["/"] i.name}.proxy_arp" i.proxyARP))
// listToAttrs (forEach interfaces
(i: let
opt = i.tempAddress;
val = tempaddrValues.${opt}.sysctl;
-
in nameValuePair "net.ipv6.conf.${replaceChars ["."] ["/"] i.name}.use_tempaddr" val));
+
in nameValuePair "net.ipv6.conf.${replaceStrings ["."] ["/"] i.name}.use_tempaddr" val));
security.wrappers = {
ping = {
···
in
''
# override to ${msg} for ${i.name}
-
ACTION=="add", SUBSYSTEM=="net", RUN+="${pkgs.procps}/bin/sysctl net.ipv6.conf.${replaceChars ["."] ["/"] i.name}.use_tempaddr=${val}"
+
ACTION=="add", SUBSYSTEM=="net", RUN+="${pkgs.procps}/bin/sysctl net.ipv6.conf.${replaceStrings ["."] ["/"] i.name}.use_tempaddr=${val}"
'') (filter (i: i.tempAddress != cfg.tempAddresses) interfaces);
})
] ++ lib.optional (cfg.wlanInterfaces != {})
+1 -1
nixos/tests/installer.nix
···
hardware.enableAllFirmware = lib.mkForce false;
-
${replaceChars ["\n"] ["\n "] extraConfig}
+
${replaceStrings ["\n"] ["\n "] extraConfig}
}
'';
+2 -2
nixos/tests/prometheus-exporters.nix
···
let
inherit (import ../lib/testing-python.nix { inherit system pkgs; }) makeTest;
inherit (pkgs.lib) concatStringsSep maintainers mapAttrs mkMerge
-
removeSuffix replaceChars singleton splitString;
+
removeSuffix replaceStrings singleton splitString;
/*
* The attrset `exporterTests` contains one attribute
···
enable = true;
extraFlags = [ "--web.collectd-push-path /collectd" ];
};
-
exporterTest = let postData = replaceChars [ "\n" ] [ "" ] ''
+
exporterTest = let postData = replaceStrings [ "\n" ] [ "" ] ''
[{
"values":[23],
"dstypes":["gauge"],
+1 -1
pkgs/applications/audio/munt/libmt32emu.nix
···
src = fetchFromGitHub {
owner = "munt";
repo = "munt";
-
rev = "${pname}_${lib.replaceChars [ "." ] [ "_" ] version}";
+
rev = "${pname}_${lib.replaceStrings [ "." ] [ "_" ] version}";
sha256 = "sha256-XGds9lDfSiY0D8RhYG4TGyjYEVvVYuAfNSv9+VxiJEs=";
};
+1 -1
pkgs/applications/audio/munt/mt32emu-qt.nix
···
}:
let
-
char2underscore = char: str: lib.replaceChars [ char ] [ "_" ] str;
+
char2underscore = char: str: lib.replaceStrings [ char ] [ "_" ] str;
in
mkDerivation rec {
pname = "mt32emu-qt";
+1 -1
pkgs/applications/audio/munt/mt32emu-smf2wav.nix
···
}:
let
-
char2underscore = char: str: lib.replaceChars [ char ] [ "_" ] str;
+
char2underscore = char: str: lib.replaceStrings [ char ] [ "_" ] str;
in
stdenv.mkDerivation rec {
pname = "mt32emu-smf2wav";
+1 -1
pkgs/applications/audio/qjackctl/default.nix
···
src = fetchFromGitHub {
owner = "rncbc";
repo = "qjackctl";
-
rev = "${pname}_${lib.replaceChars ["."] ["_"] version}";
+
rev = "${pname}_${lib.replaceStrings ["."] ["_"] version}";
sha256 = "sha256-PchW9cM5qEP51G9RXUZ3j/AvKqTkgNiw3esqSQqsy0M=";
};
+1 -1
pkgs/applications/audio/roomeqwizard/default.nix
···
version = "5.20.5";
src = fetchurl {
-
url = "https://www.roomeqwizard.com/installers/REW_linux_${lib.replaceChars [ "." ] [ "_" ] version}.sh";
+
url = "https://www.roomeqwizard.com/installers/REW_linux_${lib.replaceStrings [ "." ] [ "_" ] version}.sh";
sha256 = "NYTRiOZmwkni4k+jI2SV84z5umO7+l+eKpwPCdlDD3U=";
};
+1 -1
pkgs/applications/editors/jetbrains/linux.nix
···
desktopItem = makeDesktopItem {
name = pname;
exec = pname;
-
comment = lib.replaceChars ["\n"] [" "] meta.longDescription;
+
comment = lib.replaceStrings ["\n"] [" "] meta.longDescription;
desktopName = product;
genericName = meta.description;
categories = [ "Development" ];
+1 -1
pkgs/applications/emulators/atari800/default.nix
···
src = fetchFromGitHub {
owner = "atari800";
repo = "atari800";
-
rev = "ATARI800_${replaceChars ["."] ["_"] version}";
+
rev = "ATARI800_${replaceStrings ["."] ["_"] version}";
sha256 = "sha256-+eJXhqPyU0GhmzF7DbteTXzEnn5klCor9Io/UgXQfQg=";
};
+1 -1
pkgs/applications/emulators/desmume/default.nix
···
src = fetchFromGitHub {
owner = "TASVideos";
repo = "desmume";
-
rev = "release_${lib.replaceChars ["."] ["_"] finalAttrs.version}";
+
rev = "release_${lib.replaceStrings ["."] ["_"] finalAttrs.version}";
hash = "sha256-vmjKXa/iXLTwtqnG+ZUvOnOQPZROeMpfM5J3Jh/Ynfo=";
};
+1 -1
pkgs/applications/emulators/retroarch/mkLibretroCore.nix
···
}@args:
let
-
d2u = if normalizeCore then (lib.replaceChars [ "-" ] [ "_" ]) else (x: x);
+
d2u = if normalizeCore then (lib.replaceStrings [ "-" ] [ "_" ]) else (x: x);
coreDir = placeholder "out" + libretroCore;
coreFilename = "${d2u core}_libretro${stdenv.hostPlatform.extensions.sharedLibrary}";
mainProgram = "retroarch-${core}";
+1 -1
pkgs/applications/misc/sweethome3d/default.nix
···
};
};
-
d2u = lib.replaceChars ["."] ["_"];
+
d2u = lib.replaceStrings ["."] ["_"];
in {
+1 -1
pkgs/applications/misc/sweethome3d/editors.nix
···
};
-
d2u = lib.replaceChars ["."] ["_"];
+
d2u = lib.replaceStrings ["."] ["_"];
in {
+1 -1
pkgs/applications/science/math/weka/default.nix
···
version = "3.9.6";
src = fetchurl {
-
url = "mirror://sourceforge/weka/${lib.replaceChars ["."]["-"] "${pname}-${version}"}.zip";
+
url = "mirror://sourceforge/weka/${lib.replaceStrings ["."]["-"] "${pname}-${version}"}.zip";
sha256 = "sha256-8fVN4MXYqXNEmyVtXh1IrauHTBZWgWG8AvsGI5Y9Aj0=";
};
+1 -1
pkgs/applications/science/misc/openmodelica/omlibrary/fakegit.nix
···
hashname = r:
let
-
rpl = lib.replaceChars [ ":" "/" ] [ "_" "_" ];
+
rpl = lib.replaceStrings [ ":" "/" ] [ "_" "_" ];
in
(rpl r.url) + "-" + (rpl r.rev);
+3 -3
pkgs/build-support/fetchmavenartifact/default.nix
···
let
name_ =
lib.concatStrings [
-
(lib.replaceChars ["."] ["_"] groupId) "_"
-
(lib.replaceChars ["."] ["_"] artifactId) "-"
+
(lib.replaceStrings ["."] ["_"] groupId) "_"
+
(lib.replaceStrings ["."] ["_"] artifactId) "-"
version
];
mkJarUrl = repoUrl:
lib.concatStringsSep "/" [
(lib.removeSuffix "/" repoUrl)
-
(lib.replaceChars ["."] ["/"] groupId)
+
(lib.replaceStrings ["."] ["/"] groupId)
artifactId
version
"${artifactId}-${version}${lib.optionalString (!isNull classifier) "-${classifier}"}.jar"
+1 -1
pkgs/build-support/rust/build-rust-crate/configure-crate.nix
···
completeDepsDir = lib.concatStringsSep " " completeDeps;
completeBuildDepsDir = lib.concatStringsSep " " completeBuildDeps;
envFeatures = lib.concatStringsSep " " (
-
map (f: lib.replaceChars ["-"] ["_"] (lib.toUpper f)) crateFeatures
+
map (f: lib.replaceStrings ["-"] ["_"] (lib.toUpper f)) crateFeatures
);
in ''
${echo_colored colors}
+1 -1
pkgs/development/compilers/elm/makeDotElm.nix
···
ver: deps:
let cmds = lib.mapAttrsToList (name: info: let
pkg = stdenv.mkDerivation {
-
name = lib.replaceChars ["/"] ["-"] name + "-${info.version}";
+
name = lib.replaceStrings ["/"] ["-"] name + "-${info.version}";
src = fetchurl {
url = "https://github.com/${name}/archive/${info.version}.tar.gz";
+1 -1
pkgs/development/interpreters/gauche/default.nix
···
src = fetchFromGitHub {
owner = "shirok";
repo = pname;
-
rev = "release${lib.replaceChars [ "." ] [ "_" ] version}";
+
rev = "release${lib.replaceStrings [ "." ] [ "_" ] version}";
sha256 = "0ki1w7sa10ivmg51sqjskby0gsznb0d3738nz80x589033km5hmb";
};
+1 -1
pkgs/development/libraries/icu/base.nix
···
baseAttrs = {
src = fetchurl {
-
url = "https://github.com/unicode-org/icu/releases/download/release-${lib.replaceChars [ "." ] [ "-" ] version}/icu4c-${lib.replaceChars [ "." ] [ "_" ] version}-src.tgz";
+
url = "https://github.com/unicode-org/icu/releases/download/release-${lib.replaceStrings [ "." ] [ "-" ] version}/icu4c-${lib.replaceStrings [ "." ] [ "_" ] version}-src.tgz";
inherit sha256;
};
+1 -1
pkgs/development/libraries/java/hsqldb/default.nix
···
stdenv.mkDerivation rec {
pname = "hsqldb";
version = "2.7.1";
-
underscoreMajMin = lib.strings.replaceChars ["."] ["_"] (lib.versions.majorMinor version);
+
underscoreMajMin = lib.replaceStrings ["."] ["_"] (lib.versions.majorMinor version);
src = fetchurl {
url = "mirror://sourceforge/project/hsqldb/hsqldb/hsqldb_${underscoreMajMin}/hsqldb-${version}.zip";
+1 -1
pkgs/development/libraries/muparser/default.nix
···
stdenv.mkDerivation rec {
pname = "muparser";
version = "2.2.3";
-
url-version = lib.replaceChars ["."] ["_"] version;
+
url-version = lib.replaceStrings ["."] ["_"] version;
src = fetchurl {
url = "mirror://sourceforge/muparser/muparser_v${url-version}.zip";
+1 -1
pkgs/development/libraries/opendkim/default.nix
···
src = fetchFromGitHub {
owner = "trusteddomainproject";
repo = "OpenDKIM";
-
rev = "rel-opendkim-${lib.replaceChars ["."] ["-"] version}";
+
rev = "rel-opendkim-${lib.replaceStrings ["."] ["-"] version}";
sha256 = "0nx3in8sa6xna4vfacj8g60hfzk61jpj2ldag80xzxip9c3rd2pw";
};
+1 -1
pkgs/development/libraries/opensubdiv/default.nix
···
src = fetchFromGitHub {
owner = "PixarAnimationStudios";
repo = "OpenSubdiv";
-
rev = "v${lib.replaceChars ["."] ["_"] version}";
+
rev = "v${lib.replaceStrings ["."] ["_"] version}";
sha256 = "sha256-ejxQ5mGIIrEa/rAfkTrRbIRerrAvEPoWn7e0lIqS1JQ=";
};
+1 -1
pkgs/development/mobile/androidenv/build-app.nix
···
extraArgs = removeAttrs args ([ "name" ] ++ builtins.attrNames androidSdkFormalArgs);
in
stdenv.mkDerivation ({
-
name = lib.replaceChars [" "] [""] name; # Android APKs may contain white spaces in their names, but Nix store paths cannot
+
name = lib.replaceStrings [" "] [""] name; # Android APKs may contain white spaces in their names, but Nix store paths cannot
ANDROID_HOME = "${androidsdk}/libexec/android-sdk";
buildInputs = [ jdk ant ];
buildPhase = ''
+1 -1
pkgs/development/mobile/titaniumenv/build-app.nix
···
extraArgs = removeAttrs args [ "name" "preRebuild" "androidsdkArgs" "xcodewrapperArgs" ];
in
stdenv.mkDerivation ({
-
name = lib.replaceChars [" "] [""] name;
+
name = lib.replaceStrings [" "] [""] name;
buildInputs = [ nodejs titanium alloy python which file jdk ];
+1 -1
pkgs/development/mobile/xcodeenv/build-app.nix
···
extraArgs = removeAttrs args ([ "name" "scheme" "xcodeFlags" "release" "certificateFile" "certificatePassword" "provisioningProfile" "signMethod" "generateIPA" "generateXCArchive" "enableWirelessDistribution" "installURL" "bundleId" "version" ] ++ builtins.attrNames xcodewrapperFormalArgs);
in
stdenv.mkDerivation ({
-
name = lib.replaceChars [" "] [""] name; # iOS app names can contain spaces, but in the Nix store this is not allowed
+
name = lib.replaceStrings [" "] [""] name; # iOS app names can contain spaces, but in the Nix store this is not allowed
buildPhase = ''
# Be sure that the Xcode wrapper has priority over everything else.
# When using buildInputs this does not seem to be the case.
+1 -1
pkgs/development/mobile/xcodeenv/simulate-app.nix
···
xcodewrapper = composeXcodeWrapper xcodewrapperArgs;
in
stdenv.mkDerivation {
-
name = lib.replaceChars [" "] [""] name;
+
name = lib.replaceStrings [" "] [""] name;
buildCommand = ''
mkdir -p $out/bin
cat > $out/bin/run-test-simulator << "EOF"
+1 -1
pkgs/development/python-modules/scikit-learn/default.nix
···
changelog = let
major = versions.major version;
minor = versions.minor version;
-
dashVer = replaceChars ["."] ["-"] version;
+
dashVer = replaceStrings ["."] ["-"] version;
in
"https://scikit-learn.org/stable/whats_new/v${major}.${minor}.html#version-${dashVer}";
homepage = "https://scikit-learn.org";
+2 -2
pkgs/development/tools/haskell/lambdabot/default.nix
···
++ lib.optional withDjinn haskellPackages.djinn
++ lib.optional (aspell != null) aspell
);
-
modulesStr = lib.replaceChars ["\n"] [" "] modules;
-
configStr = lib.replaceChars ["\n"] [" "] configuration;
+
modulesStr = lib.replaceStrings ["\n"] [" "] modules;
+
configStr = lib.replaceStrings ["\n"] [" "] configuration;
in haskellLib.overrideCabal (self: {
patches = (self.patches or []) ++ [ ./custom-config.patch ];
+1 -1
pkgs/development/tools/misc/segger-ozone/default.nix
···
version = "3.22a";
src = fetchurl {
-
url = "https://www.segger.com/downloads/jlink/Ozone_Linux_V${(lib.replaceChars ["."] [""] version)}_x86_64.tgz";
+
url = "https://www.segger.com/downloads/jlink/Ozone_Linux_V${(lib.replaceStrings ["."] [""] version)}_x86_64.tgz";
sha256 = "0v1r8qvp1w2f3yip9fys004pa0smlmq69p7w77lfvghs1rmg1649";
};
+1 -1
pkgs/development/web/kcgi/default.nix
···
stdenv.mkDerivation rec {
pname = "kcgi";
version = "0.10.8";
-
underscoreVersion = lib.replaceChars ["."] ["_"] version;
+
underscoreVersion = lib.replaceStrings ["."] ["_"] version;
src = fetchFromGitHub {
owner = "kristapsdz";
+1 -1
pkgs/games/nexuiz/default.nix
···
let
version = "2.5.2";
-
version_short = lib.replaceChars [ "." ] [ "" ] version;
+
version_short = lib.replaceStrings [ "." ] [ "" ] version;
in stdenv.mkDerivation {
pname = "nexuiz";
inherit version;
+1 -1
pkgs/games/terraria-server/default.nix
···
stdenv.mkDerivation rec {
pname = "terraria-server";
version = "1.4.4.9";
-
urlVersion = lib.replaceChars [ "." ] [ "" ] version;
+
urlVersion = lib.replaceStrings [ "." ] [ "" ] version;
src = fetchurl {
url = "https://terraria.org/api/download/pc-dedicated-server/terraria-server-${urlVersion}.zip";
+1 -1
pkgs/servers/invidious/default.nix
···
substituteInPlace src/invidious.cr \
--replace ${lib.escapeShellArg branchTemplate} '"master"' \
--replace ${lib.escapeShellArg commitTemplate} '"${lib.substring 0 7 versions.invidious.rev}"' \
-
--replace ${lib.escapeShellArg versionTemplate} '"${lib.replaceChars ["-"] ["."] (lib.substring 9 10 version)}"' \
+
--replace ${lib.escapeShellArg versionTemplate} '"${lib.replaceStrings ["-"] ["."] (lib.substring 9 10 version)}"' \
--replace ${lib.escapeShellArg assetCommitTemplate} '"${lib.substring 0 7 versions.invidious.rev}"'
# Patch the assets and locales paths to be absolute
+1 -1
pkgs/tools/typesetting/tex/pgf-tikz/pgf-1.x.nix
···
src = fetchFromGitHub {
owner = "pgf-tikz";
repo = "pgf";
-
rev = "refs/tags/version-${lib.replaceChars ["."] ["-"] finalAttrs.version}";
+
rev = "refs/tags/version-${lib.replaceStrings ["."] ["-"] finalAttrs.version}";
hash = "sha256-WZ/191iEDd5VK1bnV9JZx2BZfACUeAUhAqrlyx+ZvA4=";
};
+1 -1
pkgs/top-level/haxe-packages.nix
···
self = haxePackages;
haxePackages = with self; {
-
withCommas = lib.replaceChars ["."] [","];
+
withCommas = lib.replaceStrings ["."] [","];
# simulate "haxelib dev $libname ."
simulateHaxelibDev = libname: ''