mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 01:24:09 +01:00
nixos: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:
builtins=(
abort
baseNameOf
break
derivation
derivationStrict
dirOf
false
fetchGit
fetchMercurial
fetchTarball
fetchTree
fromTOML
import
isNull
map
null
placeholder
removeAttrs
scopedImport
throw
toString
true
)
fd \
--exclude doc/manual/release-notes \
--type file \
. \
nixos \
--exec-batch sed --in-place --regexp-extended "
s/\<builtins\.($(
printf '%s\n' "${builtins[@]}" |
paste --delimiter '|' --serial -
))\>/\1/g
"
nix fmt
This commit is contained in:
parent
54671be46b
commit
a2ed7e8d88
219 changed files with 392 additions and 423 deletions
|
|
@ -39,7 +39,7 @@ let
|
|||
inherit prefix modules;
|
||||
class = "nixos";
|
||||
specialArgs = {
|
||||
modulesPath = builtins.toString ../modules;
|
||||
modulesPath = toString ../modules;
|
||||
}
|
||||
// specialArgs;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ pkgs.stdenv.mkDerivation {
|
|||
return 1
|
||||
fi
|
||||
|
||||
if [ ${builtins.toString compressImage} ]; then
|
||||
if [ ${toString compressImage} ]; then
|
||||
echo "Compressing image"
|
||||
zstd -v --no-progress ./$img -o $out
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ pkgs.stdenv.mkDerivation {
|
|||
|
||||
resize2fs $img $new_size
|
||||
|
||||
if [ ${builtins.toString compressImage} ]; then
|
||||
if [ ${toString compressImage} ]; then
|
||||
echo "Compressing image"
|
||||
zstd -T$NIX_BUILD_CORES -v --no-progress ./$img -o $out
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ rec {
|
|||
toIntBaseDetected =
|
||||
value:
|
||||
assert (match "[0-9]+|0x[0-9a-fA-F]+" value) != null;
|
||||
(builtins.fromTOML "v=${value}").v;
|
||||
(fromTOML "v=${value}").v;
|
||||
|
||||
hexChars = stringToCharacters "0123456789abcdefABCDEF";
|
||||
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ let
|
|||
${lib.optionalString (!config.skipTypeCheck) ''
|
||||
# prepend type hints so the test script can be type checked with mypy
|
||||
cat "${../test-script-prepend.py}" >> testScriptWithTypes
|
||||
echo "${builtins.toString machineNames}" >> testScriptWithTypes
|
||||
echo "${builtins.toString vlanNames}" >> testScriptWithTypes
|
||||
echo "${toString machineNames}" >> testScriptWithTypes
|
||||
echo "${toString vlanNames}" >> testScriptWithTypes
|
||||
echo -n "$testScript" >> testScriptWithTypes
|
||||
|
||||
echo "Running type check (enable/disable: config.skipTypeCheck)"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ let
|
|||
cfg = config.services.fanout;
|
||||
mknodCmds =
|
||||
n:
|
||||
lib.lists.imap0 (i: s: "mknod /dev/fanout${builtins.toString i} c $MAJOR ${builtins.toString i}") (
|
||||
lib.lists.imap0 (i: s: "mknod /dev/fanout${toString i} c $MAJOR ${toString i}") (
|
||||
lib.lists.replicate n ""
|
||||
);
|
||||
in
|
||||
|
|
@ -33,7 +33,7 @@ in
|
|||
boot.kernelModules = [ "fanout" ];
|
||||
|
||||
boot.extraModprobeConfig = ''
|
||||
options fanout buffersize=${builtins.toString cfg.bufferSize}
|
||||
options fanout buffersize=${toString cfg.bufferSize}
|
||||
'';
|
||||
|
||||
systemd.services.fanout = {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ let
|
|||
(lib.mapAttrs (n: v: (sanitizeUTF8Capitalization v)))
|
||||
(lib.mapAttrsToList (LCRole: lang: lang + "/" + (config.i18n.localeCharsets.${LCRole} or "UTF-8")))
|
||||
]
|
||||
++ (builtins.map sanitizeUTF8Capitalization (
|
||||
++ (map sanitizeUTF8Capitalization (
|
||||
lib.optionals (builtins.isList config.i18n.extraLocales) config.i18n.extraLocales
|
||||
))
|
||||
++ (lib.optional (builtins.isString config.i18n.extraLocales) config.i18n.extraLocales);
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ in
|
|||
services.zram-generator.enable = true;
|
||||
|
||||
services.zram-generator.settings = lib.listToAttrs (
|
||||
builtins.map (dev: {
|
||||
map (dev: {
|
||||
name = dev;
|
||||
value =
|
||||
let
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ in
|
|||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${cfg.package}/bin/ckb-next-daemon ${
|
||||
lib.optionalString (cfg.gid != null) "--gid=${builtins.toString cfg.gid}"
|
||||
lib.optionalString (cfg.gid != null) "--gid=${toString cfg.gid}"
|
||||
}";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ let
|
|||
sync_effects_enabled = ${toPyBoolStr cfg.syncEffectsEnabled}
|
||||
devices_off_on_screensaver = ${toPyBoolStr cfg.devicesOffOnScreensaver}
|
||||
battery_notifier = ${toPyBoolStr cfg.batteryNotifier.enable}
|
||||
battery_notifier_freq = ${builtins.toString cfg.batteryNotifier.frequency}
|
||||
battery_notifier_percent = ${builtins.toString cfg.batteryNotifier.percentage}
|
||||
battery_notifier_freq = ${toString cfg.batteryNotifier.frequency}
|
||||
battery_notifier_percent = ${toString cfg.batteryNotifier.percentage}
|
||||
|
||||
[Statistics]
|
||||
key_statistics = ${toPyBoolStr cfg.keyStatistics}
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ let
|
|||
|
||||
baseIsolinuxCfg = ''
|
||||
SERIAL 0 115200
|
||||
TIMEOUT ${builtins.toString syslinuxTimeout}
|
||||
TIMEOUT ${toString syslinuxTimeout}
|
||||
UI vesamenu.c32
|
||||
MENU BACKGROUND /isolinux/background.png
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ let
|
|||
if lib.isString value || lib.isPath value then
|
||||
"output ${name} ${value}"
|
||||
else if lib.isInt value then
|
||||
"output ${name} ${builtins.toString value}"
|
||||
"output ${name} ${toString value}"
|
||||
else if lib.isBool value then
|
||||
lib.optionalString value "output ${name}"
|
||||
else if value == null then
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ in
|
|||
default = null;
|
||||
defaultText = "if (using nixpkgsFlake.lib.nixosSystem) then self.outPath else null";
|
||||
|
||||
example = ''builtins.fetchTarball { name = "source"; sha256 = "${lib.fakeHash}"; url = "https://github.com/nixos/nixpkgs/archive/somecommit.tar.gz"; }'';
|
||||
example = ''fetchTarball { name = "source"; sha256 = "${lib.fakeHash}"; url = "https://github.com/nixos/nixpkgs/archive/somecommit.tar.gz"; }'';
|
||||
|
||||
description = ''
|
||||
The path to the nixpkgs sources used to build the system. This is automatically set up to be
|
||||
|
|
@ -30,7 +30,7 @@ in
|
|||
|
||||
This can also be optionally set if the NixOS system is not built with a flake but still uses
|
||||
pinned sources: set this to the store path for the nixpkgs sources used to build the system,
|
||||
as may be obtained by `builtins.fetchTarball`, for example.
|
||||
as may be obtained by `fetchTarball`, for example.
|
||||
|
||||
Note: the name of the store path must be "source" due to
|
||||
<https://github.com/NixOS/nix/issues/7075>.
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ in
|
|||
environment.etc = lib.mkIf (cfg.settings != { }) {
|
||||
atoprc.text = lib.concatStrings (
|
||||
lib.mapAttrsToList (n: v: ''
|
||||
${n} ${builtins.toString v}
|
||||
${n} ${toString v}
|
||||
'') cfg.settings
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ in
|
|||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.bash.promptPluginInit = ''
|
||||
export LONG_RUNNING_COMMAND_TIMEOUT=${builtins.toString cfg.timeout}
|
||||
export LONG_RUNNING_COMMAND_TIMEOUT=${toString cfg.timeout}
|
||||
export UDM_PLAY_SOUND=${if cfg.playSound then "1" else "0"}
|
||||
. "${pkgs.undistract-me}/etc/profile.d/undistract-me.sh"
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ in
|
|||
# See <https://github.com/sosy-lab/benchexec/blob/3.18/doc/INSTALL.md#setting-up-cgroups>.
|
||||
systemd.services = builtins.listToAttrs (
|
||||
map (user: {
|
||||
name = "user@${builtins.toString (uid user)}";
|
||||
name = "user@${toString (uid user)}";
|
||||
value = {
|
||||
serviceConfig.Delegate = "yes";
|
||||
overrideStrategy = "asDropin";
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ in
|
|||
}) cfg.preferences
|
||||
);
|
||||
ExtensionSettings = builtins.listToAttrs (
|
||||
builtins.map (
|
||||
map (
|
||||
lang:
|
||||
lib.attrsets.nameValuePair "langpack-${lang}@firefox.mozilla.org" {
|
||||
installation_mode = "normal_installed";
|
||||
|
|
|
|||
|
|
@ -34,14 +34,13 @@ let
|
|||
extraArgs = [ ];
|
||||
};
|
||||
args = lib.escapeShellArgs (
|
||||
opts.extraArgs
|
||||
++ (lib.optional (opts.profile != null) "--profile=${builtins.toString opts.profile}")
|
||||
opts.extraArgs ++ (lib.optional (opts.profile != null) "--profile=${toString opts.profile}")
|
||||
);
|
||||
in
|
||||
''
|
||||
cat <<_EOF >$out/bin/${command}
|
||||
#! ${pkgs.runtimeShell} -e
|
||||
exec /run/wrappers/bin/firejail ${args} -- ${builtins.toString opts.executable} "\$@"
|
||||
exec /run/wrappers/bin/firejail ${args} -- ${toString opts.executable} "\$@"
|
||||
_EOF
|
||||
chmod 0755 $out/bin/${command}
|
||||
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ in
|
|||
pkgs.buildEnv {
|
||||
name = "system_fish-completions";
|
||||
ignoreCollisions = true;
|
||||
paths = builtins.map generateCompletions config.environment.systemPackages;
|
||||
paths = map generateCompletions config.environment.systemPackages;
|
||||
};
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ in
|
|||
|
||||
environment.etc."fuse.conf".text = ''
|
||||
${lib.optionalString (!cfg.userAllowOther) "#"}user_allow_other
|
||||
mount_max = ${builtins.toString cfg.mountMax}
|
||||
mount_max = ${toString cfg.mountMax}
|
||||
'';
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ let
|
|||
gamescope =
|
||||
let
|
||||
wrapperArgs =
|
||||
lib.optional (cfg.args != [ ]) ''--add-flags "${builtins.toString cfg.args}"''
|
||||
lib.optional (cfg.args != [ ]) ''--add-flags "${toString cfg.args}"''
|
||||
++ builtins.attrValues (builtins.mapAttrs (var: val: "--set-default ${var} ${val}") cfg.env);
|
||||
in
|
||||
pkgs.runCommand "gamescope" { nativeBuildInputs = [ pkgs.makeBinaryWrapper ]; } ''
|
||||
mkdir -p $out/bin
|
||||
makeWrapper ${cfg.package}/bin/gamescope $out/bin/gamescope --inherit-argv0 \
|
||||
${builtins.toString wrapperArgs}
|
||||
${toString wrapperArgs}
|
||||
ln -s ${cfg.package}/bin/gamescopectl $out/bin/gamescopectl
|
||||
'';
|
||||
in
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@ let
|
|||
fmt =
|
||||
value:
|
||||
if builtins.isList value then
|
||||
builtins.concatStringsSep " " (builtins.map fmt value)
|
||||
builtins.concatStringsSep " " (map fmt value)
|
||||
else if builtins.isString value then
|
||||
value
|
||||
else if builtins.isBool value then
|
||||
if value then "1" else "0"
|
||||
else if builtins.isInt value then
|
||||
builtins.toString value
|
||||
toString value
|
||||
else
|
||||
throw "Unrecognized type ${builtins.typeOf value} in htop settings";
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ in
|
|||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
environment.variables = {
|
||||
LESSKEYIN_SYSTEM = builtins.toString lessKey;
|
||||
LESSKEYIN_SYSTEM = toString lessKey;
|
||||
}
|
||||
// lib.optionalAttrs (cfg.lessopen != null) {
|
||||
LESSOPEN = cfg.lessopen;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ in
|
|||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ liboping ];
|
||||
security.wrappers = lib.mkMerge (
|
||||
builtins.map
|
||||
map
|
||||
(exec: {
|
||||
"${exec}" = {
|
||||
owner = "root";
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ in
|
|||
bindings =
|
||||
let
|
||||
light = "${pkgs.light}/bin/light";
|
||||
step = builtins.toString cfg.brightnessKeys.step;
|
||||
minBrightness = builtins.toString cfg.brightnessKeys.minBrightness;
|
||||
step = toString cfg.brightnessKeys.step;
|
||||
minBrightness = toString cfg.brightnessKeys.minBrightness;
|
||||
in
|
||||
[
|
||||
{
|
||||
|
|
|
|||
|
|
@ -171,12 +171,12 @@ in
|
|||
builtins.attrValues (
|
||||
builtins.mapAttrs (name: value: {
|
||||
name = "xdg/nvim/${name}";
|
||||
value = builtins.removeAttrs (
|
||||
value = removeAttrs (
|
||||
value
|
||||
// {
|
||||
target = "xdg/nvim/${value.target}";
|
||||
}
|
||||
) (lib.optionals (builtins.isNull value.source) [ "source" ]);
|
||||
) (lib.optionals (isNull value.source) [ "source" ]);
|
||||
}) cfg.runtime
|
||||
)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ in
|
|||
script = ''
|
||||
umask 127
|
||||
rm -f ${nncpCfgFile}
|
||||
for f in ${jsonCfgFile} ${builtins.toString config.programs.nncp.secrets}
|
||||
for f in ${jsonCfgFile} ${toString config.programs.nncp.secrets}
|
||||
do
|
||||
${lib.getExe pkgs.hjson-go} -c <"$f"
|
||||
done |${lib.getExe pkgs.jq} --slurp 'reduce .[] as $x ({}; . * $x)' >${nncpCfgFile}
|
||||
|
|
|
|||
|
|
@ -10,18 +10,16 @@ let
|
|||
|
||||
configFile = ''
|
||||
${cfg.chain.type}_chain
|
||||
${lib.optionalString (
|
||||
cfg.chain.type == "random"
|
||||
) "chain_len = ${builtins.toString cfg.chain.length}"}
|
||||
${lib.optionalString (cfg.chain.type == "random") "chain_len = ${toString cfg.chain.length}"}
|
||||
${lib.optionalString cfg.proxyDNS "proxy_dns"}
|
||||
${lib.optionalString cfg.quietMode "quiet_mode"}
|
||||
remote_dns_subnet ${builtins.toString cfg.remoteDNSSubnet}
|
||||
tcp_read_time_out ${builtins.toString cfg.tcpReadTimeOut}
|
||||
tcp_connect_time_out ${builtins.toString cfg.tcpConnectTimeOut}
|
||||
remote_dns_subnet ${toString cfg.remoteDNSSubnet}
|
||||
tcp_read_time_out ${toString cfg.tcpReadTimeOut}
|
||||
tcp_connect_time_out ${toString cfg.tcpConnectTimeOut}
|
||||
localnet ${cfg.localnet}
|
||||
[ProxyList]
|
||||
${builtins.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (k: v: "${v.type} ${v.host} ${builtins.toString v.port}") (
|
||||
lib.mapAttrsToList (k: v: "${v.type} ${v.host} ${toString v.port}") (
|
||||
lib.filterAttrs (k: v: v.enable) cfg.proxies
|
||||
)
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ in
|
|||
environment.systemPackages = [ pkgs.spaceFM ];
|
||||
|
||||
environment.etc."spacefm/spacefm.conf".text = lib.concatStrings (
|
||||
lib.mapAttrsToList (n: v: "${n}=${builtins.toString v}\n") cfg.settings
|
||||
lib.mapAttrsToList (n: v: "${n}=${toString v}\n") cfg.settings
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ let
|
|||
knownHostsFiles = [
|
||||
"/etc/ssh/ssh_known_hosts"
|
||||
]
|
||||
++ builtins.map pkgs.copyPathToStore cfg.knownHostsFiles;
|
||||
++ map pkgs.copyPathToStore cfg.knownHostsFiles;
|
||||
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ let
|
|||
in
|
||||
pkgs.writeShellScriptBin "steam-gamescope" ''
|
||||
${builtins.concatStringsSep "\n" exports}
|
||||
gamescope --steam ${builtins.toString cfg.gamescopeSession.args} -- steam ${builtins.toString cfg.gamescopeSession.steamArgs}
|
||||
gamescope --steam ${toString cfg.gamescopeSession.args} -- steam ${toString cfg.gamescopeSession.steamArgs}
|
||||
'';
|
||||
|
||||
gamescopeSessionFile =
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ let
|
|||
""
|
||||
# just output key if value is `true`
|
||||
else if isInt value then
|
||||
" ${builtins.toString value}"
|
||||
" ${toString value}"
|
||||
else if path.check value then
|
||||
" \"${value}\""
|
||||
# enclose path in ".."
|
||||
|
|
|
|||
|
|
@ -85,13 +85,13 @@ in
|
|||
|
||||
environment.etc.projects.source = pkgs.writeText "etc-project" (
|
||||
builtins.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (name: opts: "${builtins.toString opts.id}:${opts.path}") cfg.projects
|
||||
lib.mapAttrsToList (name: opts: "${toString opts.id}:${opts.path}") cfg.projects
|
||||
)
|
||||
);
|
||||
|
||||
environment.etc.projid.source = pkgs.writeText "etc-projid" (
|
||||
builtins.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (name: opts: "${name}:${builtins.toString opts.id}") cfg.projects
|
||||
lib.mapAttrsToList (name: opts: "${name}:${toString opts.id}") cfg.projects
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ in
|
|||
"${pkgs.xss-lock}/bin/xss-lock"
|
||||
"--session \${XDG_SESSION_ID}"
|
||||
]
|
||||
++ (builtins.map lib.escapeShellArg cfg.extraOptions)
|
||||
++ (map lib.escapeShellArg cfg.extraOptions)
|
||||
++ [
|
||||
"--"
|
||||
cfg.lockerCommand
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ in
|
|||
path = [ pkgs.gnupg ];
|
||||
|
||||
environment = {
|
||||
YUBIKEY_TOUCH_DETECTOR_LIBNOTIFY = builtins.toString cfg.libnotify;
|
||||
YUBIKEY_TOUCH_DETECTOR_NOSOCKET = builtins.toString (!cfg.unixSocket);
|
||||
YUBIKEY_TOUCH_DETECTOR_VERBOSE = builtins.toString cfg.verbose;
|
||||
YUBIKEY_TOUCH_DETECTOR_LIBNOTIFY = toString cfg.libnotify;
|
||||
YUBIKEY_TOUCH_DETECTOR_NOSOCKET = toString (!cfg.unixSocket);
|
||||
YUBIKEY_TOUCH_DETECTOR_VERBOSE = toString cfg.verbose;
|
||||
};
|
||||
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
|
|
|
|||
|
|
@ -254,8 +254,8 @@ in
|
|||
|
||||
# Setup command line history.
|
||||
# Don't export these, otherwise other shells (bash) will try to use same HISTFILE.
|
||||
SAVEHIST=${builtins.toString cfg.histSize}
|
||||
HISTSIZE=${builtins.toString cfg.histSize}
|
||||
SAVEHIST=${toString cfg.histSize}
|
||||
HISTSIZE=${toString cfg.histSize}
|
||||
HISTFILE=${cfg.histFile}
|
||||
|
||||
# Configure sane keyboard defaults.
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ let
|
|||
# We need to collect all the ACME webroots to grant them write
|
||||
# access in the systemd service.
|
||||
webroots = lib.remove null (
|
||||
lib.unique (builtins.map (certAttrs: certAttrs.webroot) (lib.attrValues config.security.acme.certs))
|
||||
lib.unique (map (certAttrs: certAttrs.webroot) (lib.attrValues config.security.acme.certs))
|
||||
);
|
||||
|
||||
certificateKey = if data.csrKey != null then "${data.csrKey}" else "certificates/${keyName}.key";
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ let
|
|||
else if lib.isList v then
|
||||
lib.concatStringsSep " " (map prepareConfigValue v)
|
||||
else
|
||||
builtins.toString v;
|
||||
toString v;
|
||||
prepareConfigText =
|
||||
conf:
|
||||
lib.concatLines (
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ let
|
|||
chmod "u${if setuid then "+" else "-"}s,g${if setgid then "+" else "-"}s,${permissions}" "$wrapperDir/${program}"
|
||||
'';
|
||||
|
||||
mkWrappedPrograms = builtins.map (
|
||||
mkWrappedPrograms = map (
|
||||
opts: if opts.capabilities != "" then mkSetcapProgram opts else mkSetuidProgram opts
|
||||
) (lib.attrValues wrappers);
|
||||
in
|
||||
|
|
|
|||
|
|
@ -237,9 +237,9 @@ in
|
|||
);
|
||||
|
||||
pluginExtraConfigs = builtins.listToAttrs (
|
||||
builtins.map (
|
||||
pluginConfig: lib.attrsets.nameValuePair pluginConfig.configName pluginConfig.extraConfig
|
||||
) (lib.lists.filter (pluginCfg: pluginCfg.configName != null) cfg.plugins)
|
||||
map (pluginConfig: lib.attrsets.nameValuePair pluginConfig.configName pluginConfig.extraConfig) (
|
||||
lib.lists.filter (pluginCfg: pluginCfg.configName != null) cfg.plugins
|
||||
)
|
||||
);
|
||||
|
||||
config = lib.attrsets.recursiveUpdate cfg.extraConfig {
|
||||
|
|
@ -250,9 +250,9 @@ in
|
|||
|
||||
plugins = pluginExtraConfigs;
|
||||
lavalink.plugins = (
|
||||
builtins.map (
|
||||
map (
|
||||
pluginConfig:
|
||||
builtins.removeAttrs pluginConfig [
|
||||
removeAttrs pluginConfig [
|
||||
"name"
|
||||
"extraConfig"
|
||||
"hash"
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ let
|
|||
)
|
||||
) a;
|
||||
nonBlockSettings = lib.filterAttrs (n: v: !(builtins.isAttrs v || builtins.isList v)) cfg.settings;
|
||||
pureBlockSettings = builtins.removeAttrs cfg.settings (builtins.attrNames nonBlockSettings);
|
||||
pureBlockSettings = removeAttrs cfg.settings (builtins.attrNames nonBlockSettings);
|
||||
blocks =
|
||||
pureBlockSettings
|
||||
// lib.optionalAttrs cfg.fluidsynth {
|
||||
|
|
|
|||
|
|
@ -282,11 +282,9 @@ in
|
|||
(lib.mkIf (cfg.extraModules != [ ]) {
|
||||
services.pulseaudio.daemon.config.dl-search-path =
|
||||
let
|
||||
overriddenModules = builtins.map (
|
||||
drv: drv.override { pulseaudio = overriddenPackage; }
|
||||
) cfg.extraModules;
|
||||
overriddenModules = map (drv: drv.override { pulseaudio = overriddenPackage; }) cfg.extraModules;
|
||||
modulePaths =
|
||||
builtins.map (drv: "${drv}/lib/pulseaudio/modules")
|
||||
map (drv: "${drv}/lib/pulseaudio/modules")
|
||||
# User-provided extra modules take precedence
|
||||
(overriddenModules ++ [ overriddenPackage ]);
|
||||
in
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ in
|
|||
serviceConfig = {
|
||||
DynamicUser = true;
|
||||
ExecStart = "${bin} -N ${dataDir}/player-name ${cfg.extraArguments}";
|
||||
StateDirectory = builtins.baseNameOf dataDir;
|
||||
StateDirectory = baseNameOf dataDir;
|
||||
SupplementaryGroups = "audio";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ let
|
|||
(lib.concatStringsSep "," permissions)
|
||||
dataset
|
||||
]}
|
||||
${lib.optionalString ((builtins.dirOf dataset) != ".") ''
|
||||
${lib.optionalString ((dirOf dataset) != ".") ''
|
||||
else
|
||||
${lib.escapeShellArgs [
|
||||
"/run/booted-system/sw/bin/zfs"
|
||||
|
|
@ -58,7 +58,7 @@ let
|
|||
cfg.user
|
||||
(lib.concatStringsSep "," permissions)
|
||||
# Remove the last part of the path
|
||||
(builtins.dirOf dataset)
|
||||
(dirOf dataset)
|
||||
]}
|
||||
''}
|
||||
fi
|
||||
|
|
@ -82,14 +82,14 @@ let
|
|||
(lib.concatStringsSep "," permissions)
|
||||
dataset
|
||||
]}
|
||||
${lib.optionalString ((builtins.dirOf dataset) != ".") (
|
||||
${lib.optionalString ((dirOf dataset) != ".") (
|
||||
lib.escapeShellArgs [
|
||||
"/run/booted-system/sw/bin/zfs"
|
||||
"unallow"
|
||||
cfg.user
|
||||
(lib.concatStringsSep "," permissions)
|
||||
# Remove the last part of the path
|
||||
(builtins.dirOf dataset)
|
||||
(dirOf dataset)
|
||||
]
|
||||
)}
|
||||
''}";
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ let
|
|||
lib.optionalString (value != null) ''
|
||||
<property>
|
||||
<name>${name}</name>
|
||||
<value>${builtins.toString value}</value>
|
||||
<value>${toString value}</value>
|
||||
</property>
|
||||
'';
|
||||
siteXml =
|
||||
|
|
@ -22,7 +22,7 @@ let
|
|||
</configuration>
|
||||
'';
|
||||
cfgLine = name: value: ''
|
||||
${name}=${builtins.toString value}
|
||||
${name}=${toString value}
|
||||
'';
|
||||
cfgFile =
|
||||
fileName: properties:
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ let
|
|||
# source is a store path containing the complete manifest file
|
||||
source = mkManifestSource "auto-deploy-chart-${name}" (
|
||||
lib.singleton (mkHelmChartCR name value)
|
||||
++ builtins.map (x: fromYaml (mkExtraDeployManifest x)) value.extraDeploy
|
||||
++ map (x: fromYaml (mkExtraDeployManifest x)) value.extraDeploy
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -384,7 +384,7 @@ let
|
|||
target = lib.mkDefault (mkManifestTarget name);
|
||||
source = lib.mkIf (config.content != null) (
|
||||
let
|
||||
name' = "${name}-manifest-" + builtins.baseNameOf name;
|
||||
name' = "${name}-manifest-" + baseNameOf name;
|
||||
mkSource = mkManifestSource name';
|
||||
in
|
||||
lib.mkDerivedConfig options.content mkSource
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ in
|
|||
tagStr =
|
||||
name: value:
|
||||
if lib.isList value then
|
||||
lib.concatStringsSep "," (builtins.map (v: "${name}=${v}") value)
|
||||
lib.concatStringsSep "," (map (v: "${name}=${v}") value)
|
||||
else
|
||||
"${name}=${value}";
|
||||
tagsStr = lib.concatStringsSep "," (lib.mapAttrsToList tagStr cfg.tags);
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ in
|
|||
systemd.tmpfiles.settings.radicle-native-ci = lib.listToAttrs (
|
||||
map (
|
||||
instance:
|
||||
lib.nameValuePair (builtins.dirOf instance.settings.log) {
|
||||
lib.nameValuePair (dirOf instance.settings.log) {
|
||||
d = {
|
||||
user = config.users.users.radicle.name;
|
||||
group = config.users.groups.radicle.name;
|
||||
|
|
|
|||
|
|
@ -442,7 +442,7 @@ in
|
|||
cf=/etc/foundationdb/fdb.cluster
|
||||
desc=$(tr -dc A-Za-z0-9 </dev/urandom 2>/dev/null | head -c8)
|
||||
rand=$(tr -dc A-Za-z0-9 </dev/urandom 2>/dev/null | head -c8)
|
||||
echo ''${desc}:''${rand}@${initialIpAddr}:${builtins.toString cfg.listenPortStart} > $cf
|
||||
echo ''${desc}:''${rand}@${initialIpAddr}:${toString cfg.listenPortStart} > $cf
|
||||
chmod 0664 $cf
|
||||
touch "${cfg.dataDir}/.first_startup"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ let
|
|||
lib.mapAttrsToList (name: value: ''
|
||||
<property>
|
||||
<name>${name}</name>
|
||||
<value>${builtins.toString value}</value>
|
||||
<value>${toString value}</value>
|
||||
</property>
|
||||
'') configAttr
|
||||
));
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ let
|
|||
else if isString value then
|
||||
"'${lib.replaceStrings [ "'" ] [ "''" ] value}'"
|
||||
else
|
||||
builtins.toString value;
|
||||
toString value;
|
||||
|
||||
# The main PostgreSQL configuration file.
|
||||
configFile = pkgs.writeTextDir "postgresql.conf" (
|
||||
|
|
@ -83,7 +83,7 @@ let
|
|||
else if builtins.isString v then
|
||||
"${directive} '${v}'"
|
||||
else
|
||||
"${directive} ${builtins.toString v}"
|
||||
"${directive} ${toString v}"
|
||||
) user.ensureClauses;
|
||||
|
||||
generateAlterRoleSQL =
|
||||
|
|
@ -882,7 +882,7 @@ in
|
|||
};
|
||||
|
||||
path = [ cfg.finalPackage ];
|
||||
environment.PGPORT = builtins.toString cfg.settings.port;
|
||||
environment.PGPORT = toString cfg.settings.port;
|
||||
|
||||
# Wait for PostgreSQL to be ready to accept connections.
|
||||
script = ''
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ in
|
|||
|
||||
systemd.services.tigerbeetle =
|
||||
let
|
||||
replicaDataPath = "/var/lib/tigerbeetle/${builtins.toString cfg.clusterId}_${builtins.toString cfg.replicaIndex}.tigerbeetle";
|
||||
replicaDataPath = "/var/lib/tigerbeetle/${toString cfg.clusterId}_${toString cfg.replicaIndex}.tigerbeetle";
|
||||
in
|
||||
{
|
||||
description = "TigerBeetle server";
|
||||
|
|
@ -101,7 +101,7 @@ in
|
|||
|
||||
preStart = ''
|
||||
if ! test -e "${replicaDataPath}"; then
|
||||
${lib.getExe cfg.package} format --cluster="${builtins.toString cfg.clusterId}" --replica="${builtins.toString cfg.replicaIndex}" --replica-count="${builtins.toString cfg.replicaCount}" "${replicaDataPath}"
|
||||
${lib.getExe cfg.package} format --cluster="${toString cfg.clusterId}" --replica="${toString cfg.replicaIndex}" --replica-count="${toString cfg.replicaCount}" "${replicaDataPath}"
|
||||
fi
|
||||
'';
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ let
|
|||
cfg = config.services.quake3-server;
|
||||
|
||||
configFile = pkgs.writeText "q3ds-extra.cfg" ''
|
||||
set net_port ${builtins.toString cfg.port}
|
||||
set net_port ${toString cfg.port}
|
||||
|
||||
${cfg.extraConfig}
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ let
|
|||
|
||||
value = (
|
||||
if lib.isList option then
|
||||
builtins.concatStringsSep " " (builtins.map (x: toValue x) option)
|
||||
builtins.concatStringsSep " " (map (x: toValue x) option)
|
||||
else
|
||||
toValue option
|
||||
);
|
||||
|
|
|
|||
|
|
@ -114,9 +114,9 @@ in
|
|||
enable = true;
|
||||
keyboards.arsenik.config = ''
|
||||
(defvar
|
||||
tap_timeout ${builtins.toString cfg.tap_timeout}
|
||||
hold_timeout ${builtins.toString cfg.hold_timeout}
|
||||
long_hold_timeout ${builtins.toString cfg.long_hold_timeout}
|
||||
tap_timeout ${toString cfg.tap_timeout}
|
||||
hold_timeout ${toString cfg.hold_timeout}
|
||||
long_hold_timeout ${toString cfg.long_hold_timeout}
|
||||
)
|
||||
(include ${src}/defsrc/${defsrc}.kbd)
|
||||
(include ${src}/deflayer/${base}.kbd)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ in
|
|||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${cfg.package}/bin/bitbox-bridge -p ${builtins.toString cfg.port}";
|
||||
ExecStart = "${cfg.package}/bin/bitbox-bridge -p ${toString cfg.port}";
|
||||
User = "bitbox";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ in
|
|||
builtins.stringLength name <= 12
|
||||
) "Modeline name must be 12 characters or less" ''Modeline "${name}" ${value}''
|
||||
))
|
||||
(builtins.map (line: "${line}\n"))
|
||||
(map (line: "${line}\n"))
|
||||
(lib.strings.concatStringsSep "")
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ in
|
|||
path = [ ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.trezord}/bin/trezord-go ${lib.optionalString cfg.emulator.enable "-e ${builtins.toString cfg.emulator.port}"}";
|
||||
ExecStart = "${pkgs.trezord}/bin/trezord-go ${lib.optionalString cfg.emulator.enable "-e ${toString cfg.emulator.port}"}";
|
||||
User = "trezord";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ in
|
|||
RestrictSUIDSGID = true;
|
||||
PrivateMounts = true;
|
||||
CacheDirectory = "promtail";
|
||||
ReadWritePaths = lib.optional allowPositionsFile (builtins.dirOf positionsFile);
|
||||
ReadWritePaths = lib.optional allowPositionsFile (dirOf positionsFile);
|
||||
|
||||
User = "promtail";
|
||||
Group = "promtail";
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ in
|
|||
{
|
||||
ExecStart = "${lib.getExe cfg.package} --config ${
|
||||
if cfg.validateConfig then (validatedConfig conf) else conf
|
||||
} --graceful-shutdown-limit-secs ${builtins.toString cfg.gracefulShutdownLimitSecs}";
|
||||
} --graceful-shutdown-limit-secs ${toString cfg.gracefulShutdownLimitSecs}";
|
||||
DynamicUser = true;
|
||||
Restart = "always";
|
||||
StateDirectory = "vector";
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ let
|
|||
p: q:
|
||||
if (q != null) then
|
||||
if builtins.isInt q then
|
||||
"${p}=${builtins.toString q}"
|
||||
"${p}=${toString q}"
|
||||
else
|
||||
"${p}=\"${if builtins.isList q then (concatStringsSep " " q) else q}\""
|
||||
else
|
||||
|
|
@ -336,7 +336,7 @@ in
|
|||
startLimitIntervalSec = 60;
|
||||
environment = {
|
||||
CYRUS_VERBOSE = mkIf cfg.debug "1";
|
||||
LISTENQUEUE = builtins.toString cfg.listenQueue;
|
||||
LISTENQUEUE = toString cfg.listenQueue;
|
||||
};
|
||||
serviceConfig = {
|
||||
User = if (cfg.user == null) then "cyrus" else cfg.user;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ in
|
|||
Due to hardening on the systemd unit the socket can never be created world readable/writable.
|
||||
:::
|
||||
'';
|
||||
apply = value: (builtins.fromTOML "v=0o${value}").v;
|
||||
apply = value: (fromTOML "v=0o${value}").v;
|
||||
};
|
||||
|
||||
log-level = mkOption {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ let
|
|||
splitAddress = addr: lib.splitString ":" addr;
|
||||
extractPort = addr: lib.toInt (builtins.foldl' (a: b: b) "" (splitAddress addr));
|
||||
in
|
||||
builtins.map (address: extractPort address) (parseAddresses listeners);
|
||||
map (address: extractPort address) (parseAddresses listeners);
|
||||
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -325,10 +325,10 @@ in
|
|||
"--config /run/dendrite/dendrite.yaml"
|
||||
]
|
||||
++ lib.optionals (cfg.httpPort != null) [
|
||||
"--http-bind-address :${builtins.toString cfg.httpPort}"
|
||||
"--http-bind-address :${toString cfg.httpPort}"
|
||||
]
|
||||
++ lib.optionals (cfg.httpsPort != null) [
|
||||
"--https-bind-address :${builtins.toString cfg.httpsPort}"
|
||||
"--https-bind-address :${toString cfg.httpsPort}"
|
||||
"--tls-cert ${cfg.tlsCert}"
|
||||
"--tls-key ${cfg.tlsKey}"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ in
|
|||
"-n"
|
||||
cfg.settings.chunks_to_compress
|
||||
"-l"
|
||||
(lib.concatStringsSep "," (builtins.map builtins.toString cfg.settings.levels))
|
||||
(lib.concatStringsSep "," (map toString cfg.settings.levels))
|
||||
];
|
||||
LockPersonality = true;
|
||||
MemoryDenyWriteExecute = true;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ let
|
|||
${lib.concatMapStringsSep " " (x: "-c ${x}") ([ configFile ] ++ cfg.extraConfigFiles)} \
|
||||
"${listenerProtocol}://${
|
||||
if (isIpv6 bindAddress) then "[${bindAddress}]" else "${bindAddress}"
|
||||
}:${builtins.toString clientListener.port}/"
|
||||
}:${toString clientListener.port}/"
|
||||
'';
|
||||
|
||||
defaultExtras = [
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ in
|
|||
serviceConfig = {
|
||||
Type = "forking";
|
||||
PIDFile = "/run/autofs.pid";
|
||||
ExecStart = "${pkgs.autofs5}/bin/automount ${lib.optionalString cfg.debug "-d"} -p /run/autofs.pid -t ${builtins.toString cfg.timeout} ${autoMaster}";
|
||||
ExecStart = "${pkgs.autofs5}/bin/automount ${lib.optionalString cfg.debug "-d"} -p /run/autofs.pid -t ${toString cfg.timeout} ${autoMaster}";
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ in
|
|||
"--request-timeout=5"
|
||||
"--serverdir=${serverDir}"
|
||||
"--host=${cfg.host}"
|
||||
"--port=${builtins.toString cfg.port}"
|
||||
"--port=${toString cfg.port}"
|
||||
]
|
||||
++ lib.optionals (!isNull cfg.secretFile) [
|
||||
"--secretfile=${runtimeDir}/${secretsFileName}"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ let
|
|||
}
|
||||
// (lib.optionalAttrs (cfg.storagePath != null) { filesystem.rootdirectory = cfg.storagePath; });
|
||||
http = {
|
||||
addr = "${cfg.listenAddress}:${builtins.toString cfg.port}";
|
||||
addr = "${cfg.listenAddress}:${toString cfg.port}";
|
||||
headers.X-Content-Type-Options = [ "nosniff" ];
|
||||
};
|
||||
health.storagedriver = {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ in
|
|||
after = [ "network.target" ];
|
||||
|
||||
environment = {
|
||||
PORT = builtins.toString cfg.port;
|
||||
PORT = toString cfg.port;
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ in
|
|||
"d '${cfg.dataDir}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -"
|
||||
]
|
||||
++ lib.optionals (cfg.unixSocket != null) [
|
||||
"d '${builtins.dirOf cfg.unixSocket}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -"
|
||||
"d '${dirOf cfg.unixSocket}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -"
|
||||
];
|
||||
|
||||
systemd.services.etebase-server = {
|
||||
|
|
|
|||
|
|
@ -961,7 +961,7 @@ in
|
|||
puma.workers = mkOption {
|
||||
type = types.int;
|
||||
default = 2;
|
||||
apply = x: builtins.toString x;
|
||||
apply = x: toString x;
|
||||
description = ''
|
||||
The number of worker processes Puma should spawn. This
|
||||
controls the amount of parallel Ruby code can be
|
||||
|
|
@ -977,7 +977,7 @@ in
|
|||
puma.threadsMin = mkOption {
|
||||
type = types.int;
|
||||
default = 0;
|
||||
apply = x: builtins.toString x;
|
||||
apply = x: toString x;
|
||||
description = ''
|
||||
The minimum number of threads Puma should use per
|
||||
worker.
|
||||
|
|
@ -992,7 +992,7 @@ in
|
|||
puma.threadsMax = mkOption {
|
||||
type = types.int;
|
||||
default = 4;
|
||||
apply = x: builtins.toString x;
|
||||
apply = x: toString x;
|
||||
description = ''
|
||||
The maximum number of threads Puma should use per
|
||||
worker. This limits how many threads Puma will automatically
|
||||
|
|
@ -1033,7 +1033,7 @@ in
|
|||
sidekiq.memoryKiller.maxMemory = mkOption {
|
||||
type = types.int;
|
||||
default = 2000;
|
||||
apply = x: builtins.toString (x * 1024);
|
||||
apply = x: toString (x * 1024);
|
||||
description = ''
|
||||
The maximum amount of memory, in MiB, a Sidekiq worker is
|
||||
allowed to consume before being killed.
|
||||
|
|
@ -1043,7 +1043,7 @@ in
|
|||
sidekiq.memoryKiller.graceTime = mkOption {
|
||||
type = types.int;
|
||||
default = 900;
|
||||
apply = x: builtins.toString x;
|
||||
apply = x: toString x;
|
||||
description = ''
|
||||
The time MemoryKiller waits after noticing excessive memory
|
||||
consumption before killing Sidekiq.
|
||||
|
|
@ -1053,7 +1053,7 @@ in
|
|||
sidekiq.memoryKiller.shutdownWait = mkOption {
|
||||
type = types.int;
|
||||
default = 30;
|
||||
apply = x: builtins.toString x;
|
||||
apply = x: toString x;
|
||||
description = ''
|
||||
The time allowed for all jobs to finish before Sidekiq is
|
||||
killed forcefully.
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ in
|
|||
'';
|
||||
script = ''
|
||||
exec ${lib.getExe' package "guix"} publish \
|
||||
--user=${cfg.publish.user} --port=${builtins.toString cfg.publish.port} \
|
||||
--user=${cfg.publish.user} --port=${toString cfg.publish.port} \
|
||||
${lib.escapeShellArgs cfg.publish.extraArgs}
|
||||
'';
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ in
|
|||
serviceConfig = {
|
||||
Type = "idle";
|
||||
KillSignal = "SIGINT";
|
||||
ExecStart = "${cfg.package}/bin/llama-server --log-disable --host ${cfg.host} --port ${builtins.toString cfg.port} -m ${cfg.model} ${utils.escapeSystemdExecArgs cfg.extraFlags}";
|
||||
ExecStart = "${cfg.package}/bin/llama-server --log-disable --host ${cfg.host} --port ${toString cfg.port} -m ${cfg.model} ${utils.escapeSystemdExecArgs cfg.extraFlags}";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 300;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ let
|
|||
|
||||
settings =
|
||||
if (cfg.settings != null) then
|
||||
builtins.removeAttrs
|
||||
removeAttrs
|
||||
(
|
||||
cfg.settings
|
||||
// {
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ in
|
|||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.selfhosted || !builtins.isNull cfg.secretsFile;
|
||||
assertion = cfg.selfhosted || !isNull cfg.secretsFile;
|
||||
message = "Either `selfhosted` must be true, or a `secretsFile` must be configured.";
|
||||
}
|
||||
];
|
||||
|
|
@ -146,7 +146,7 @@ in
|
|||
|
||||
StateDirectory = baseNameOf stateDir;
|
||||
Environment = [
|
||||
"PORT=${builtins.toString cfg.port}"
|
||||
"PORT=${toString cfg.port}"
|
||||
"MEDIA_PATH=${cfg.mediaDir}"
|
||||
"CONFIG_PATH=${stateDir}"
|
||||
"DATABASE_PATH=${stateDir}/db/pinchflat.db"
|
||||
|
|
@ -160,7 +160,7 @@ in
|
|||
]
|
||||
++ optional cfg.selfhosted [ "RUN_CONTEXT=selfhosted" ]
|
||||
++ optional (!isNull config.time.timeZone) "TZ=${config.time.timeZone}"
|
||||
++ attrValues (mapAttrs (name: value: name + "=" + builtins.toString value) cfg.extraConfig);
|
||||
++ attrValues (mapAttrs (name: value: name + "=" + toString value) cfg.extraConfig);
|
||||
EnvironmentFile = optional (cfg.secretsFile != null) cfg.secretsFile;
|
||||
ExecStartPre = "${lib.getExe' cfg.package "migrate"}";
|
||||
ExecStart = "${getExe cfg.package} start";
|
||||
|
|
|
|||
|
|
@ -181,8 +181,8 @@ in
|
|||
environment = {
|
||||
# Configuration for our FHS userenv script
|
||||
PLEX_DATADIR = cfg.dataDir;
|
||||
PLEX_PLUGINS = lib.concatMapStringsSep ":" builtins.toString cfg.extraPlugins;
|
||||
PLEX_SCANNERS = lib.concatMapStringsSep ":" builtins.toString cfg.extraScanners;
|
||||
PLEX_PLUGINS = lib.concatMapStringsSep ":" toString cfg.extraPlugins;
|
||||
PLEX_SCANNERS = lib.concatMapStringsSep ":" toString cfg.extraScanners;
|
||||
|
||||
# The following variables should be set by the FHS userenv script:
|
||||
# PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ in
|
|||
|
||||
script = ''
|
||||
${lib.concatStringsSep "\n" (
|
||||
builtins.map (name: ''
|
||||
map (name: ''
|
||||
${name}="$(systemd-creds cat 'SECRET-${name}')"
|
||||
export ${name}
|
||||
'') (lib.attrNames cfg.credentials)
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ let
|
|||
]
|
||||
++ lib.optionals (cfg.backend != null) [ "--backend ${cfg.backend}" ]
|
||||
++ lib.optionals (cfg.device != null) [ "--device ${cfg.device}" ]
|
||||
++ lib.optionals (cfg.index != null) [ "--index ${builtins.toString cfg.index}" ]
|
||||
++ [ "--log-level ${builtins.toString cfg.log-level}" ];
|
||||
++ lib.optionals (cfg.index != null) [ "--index ${toString cfg.index}" ]
|
||||
++ [ "--log-level ${toString cfg.log-level}" ];
|
||||
in
|
||||
{
|
||||
options.services.rshim = {
|
||||
|
|
|
|||
|
|
@ -85,10 +85,10 @@ in
|
|||
DynamicUser = false;
|
||||
ExecStart = ''
|
||||
${lib.getExe cfg.package} \
|
||||
--listen "${cfg.host}:${builtins.toString cfg.port}" \
|
||||
--listen "${cfg.host}:${toString cfg.port}" \
|
||||
--data-dir ${cfg.dataDir} \
|
||||
--snapshot-versions ${builtins.toString cfg.snapshot.versions} \
|
||||
--snapshot-days ${builtins.toString cfg.snapshot.days} \
|
||||
--snapshot-versions ${toString cfg.snapshot.versions} \
|
||||
--snapshot-days ${toString cfg.snapshot.days} \
|
||||
${lib.concatMapStringsSep " " (id: "--allow-client-id ${id}") cfg.allowClientIds}
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ let
|
|||
# This is safe since we are using it as the path value, so the context
|
||||
# will still ensure that this nix store path exists on the running
|
||||
# system.
|
||||
taFile = builtins.baseNameOf (builtins.unsafeDiscardStringContext ta);
|
||||
taFile = baseNameOf (builtins.unsafeDiscardStringContext ta);
|
||||
in
|
||||
{
|
||||
name = "lib/${taDir}/${taFile}";
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ let
|
|||
|
||||
generate = lib.flip lib.pipe [
|
||||
# Remove legacy option prefixes that only exist for backwards-compat
|
||||
(lib.flip builtins.removeAttrs [
|
||||
(lib.flip removeAttrs [
|
||||
"service"
|
||||
"rendering"
|
||||
"assertions"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ let
|
|||
opt = options.services.grafana;
|
||||
provisioningSettingsFormat = pkgs.formats.yaml { };
|
||||
declarativePlugins = pkgs.linkFarm "grafana-plugins" (
|
||||
builtins.map (pkg: {
|
||||
map (pkg: {
|
||||
name = pkg.pname;
|
||||
path = pkg;
|
||||
}) cfg.declarativePlugins
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ in
|
|||
"batch_size"
|
||||
];
|
||||
in
|
||||
builtins.map deprecationWarning (builtins.filter hasImapOpt movedOptions);
|
||||
map deprecationWarning (builtins.filter hasImapOpt movedOptions);
|
||||
|
||||
services.elasticsearch.enable = lib.mkDefault cfg.provision.elasticsearch;
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ let
|
|||
cfg.extraFlags
|
||||
++ [
|
||||
"--config.file=${if cfg.enableReload then "/etc/prometheus/prometheus.yaml" else prometheusYml}"
|
||||
"--web.listen-address=${cfg.listenAddress}:${builtins.toString cfg.port}"
|
||||
"--web.listen-address=${cfg.listenAddress}:${toString cfg.port}"
|
||||
]
|
||||
++ (
|
||||
if (cfg.enableAgentMode) then
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ let
|
|||
inherit (cfg) folders port;
|
||||
listen_addr = cfg.listenAddress;
|
||||
storage_path = "$STATE_DIRECTORY";
|
||||
imap = (builtins.removeAttrs cfg.imap [ "passwordFile" ]) // {
|
||||
imap = (removeAttrs cfg.imap [ "passwordFile" ]) // {
|
||||
password = "$IMAP_PASSWORD";
|
||||
use_ssl = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ in
|
|||
}) servers.apiKeyFile;
|
||||
in
|
||||
{
|
||||
serviceConfig.LoadCredential = builtins.map ({ name, path }: "${name}:${path}") credentials;
|
||||
serviceConfig.LoadCredential = map ({ name, path }: "${name}:${path}") credentials;
|
||||
|
||||
environment = {
|
||||
METRICS_PORT = toString cfg.port;
|
||||
|
|
@ -59,7 +59,7 @@ in
|
|||
script =
|
||||
let
|
||||
apiKeys = lib.concatStringsSep "," (
|
||||
builtins.map (cred: "$(< $CREDENTIALS_DIRECTORY/${cred.name})") credentials
|
||||
map (cred: "$(< $CREDENTIALS_DIRECTORY/${cred.name})") credentials
|
||||
);
|
||||
in
|
||||
''
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ in
|
|||
];
|
||||
script = ''
|
||||
${pkgs.envsubst}/bin/envsubst -i "${configFile}" > /tmp/sachet.yaml
|
||||
exec ${pkgs.prometheus-sachet}/bin/sachet -config /tmp/sachet.yaml -listen-address ${cfg.address}:${builtins.toString cfg.port}
|
||||
exec ${pkgs.prometheus-sachet}/bin/sachet -config /tmp/sachet.yaml -listen-address ${cfg.address}:${toString cfg.port}
|
||||
'';
|
||||
|
||||
serviceConfig = {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ let
|
|||
# Remove the PeerID (an attribute of "Identity") of the temporary Kubo repo.
|
||||
# The "Pinning" section contains the "RemoteServices" section, which would prevent
|
||||
# the daemon from starting as that setting can't be changed via ipfs config replace.
|
||||
defaultConfig = builtins.removeAttrs rawDefaultConfig [
|
||||
defaultConfig = removeAttrs rawDefaultConfig [
|
||||
"Identity"
|
||||
"Pinning"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -303,12 +303,12 @@ in
|
|||
|
||||
warnings =
|
||||
lib.optional ((builtins.attrNames cfg.cellServDB) != [ cfg.cellName ]) ''
|
||||
config.services.openafsServer.cellServDB should normally only contain servers for one cell. It currently contains servers for ${builtins.toString (builtins.attrNames cfg.cellServDB)}.
|
||||
config.services.openafsServer.cellServDB should normally only contain servers for one cell. It currently contains servers for ${toString (builtins.attrNames cfg.cellServDB)}.
|
||||
''
|
||||
++
|
||||
lib.optional (useBuCellServDB && (builtins.attrNames cfg.backup.cellServDB) != [ cfg.cellName ])
|
||||
''
|
||||
config.services.openafsServer.backup.cellServDB should normally only contain servers for one cell. It currently contains servers for ${builtins.toString (builtins.attrNames cfg.cellServDB)}.
|
||||
config.services.openafsServer.backup.cellServDB should normally only contain servers for one cell. It currently contains servers for ${toString (builtins.attrNames cfg.cellServDB)}.
|
||||
'';
|
||||
|
||||
assertions = [
|
||||
|
|
|
|||
|
|
@ -15,13 +15,7 @@ let
|
|||
portRangesToString =
|
||||
ranges:
|
||||
lib.concatStringsSep "," (
|
||||
map (
|
||||
x:
|
||||
if x.from == x.to then
|
||||
builtins.toString x.from
|
||||
else
|
||||
builtins.toString x.from + "-" + builtins.toString x.to
|
||||
) ranges
|
||||
map (x: if x.from == x.to then toString x.from else toString x.from + "-" + toString x.to) ranges
|
||||
);
|
||||
|
||||
customToKeyValue = lib.generators.toKeyValue {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ in
|
|||
"${pkgs.chisel}/bin/chisel server "
|
||||
+ lib.concatStringsSep " " (
|
||||
lib.optional (cfg.host != null) "--host ${cfg.host}"
|
||||
++ lib.optional (cfg.port != null) "--port ${builtins.toString cfg.port}"
|
||||
++ lib.optional (cfg.port != null) "--port ${toString cfg.port}"
|
||||
++ lib.optional (cfg.authfile != null) "--authfile ${cfg.authfile}"
|
||||
++ lib.optional (cfg.keepalive != null) "--keepalive ${cfg.keepalive}"
|
||||
++ lib.optional (cfg.backend != null) "--backend ${cfg.backend}"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
let
|
||||
cfg = config.services.ddclient;
|
||||
dataDir = "/var/lib/ddclient";
|
||||
StateDirectory = builtins.baseNameOf dataDir;
|
||||
StateDirectory = baseNameOf dataDir;
|
||||
RuntimeDirectory = StateDirectory;
|
||||
|
||||
configFile' = pkgs.writeText "ddclient.conf" ''
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ in
|
|||
];
|
||||
RestrictNamespaces = true;
|
||||
RestrictRealtime = true;
|
||||
SocketBindAllow = "udp:${builtins.toString cfg.api_iroh.port}";
|
||||
SocketBindAllow = "udp:${toString cfg.api_iroh.port}";
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = [
|
||||
"@system-service"
|
||||
|
|
@ -359,14 +359,14 @@ in
|
|||
enableACME = mkOverride 99 true;
|
||||
forceSSL = mkOverride 99 true;
|
||||
locations.${cfg.nginx.path_ws} = {
|
||||
proxyPass = "http://127.0.0.1:${builtins.toString cfg.api_ws.port}/";
|
||||
proxyPass = "http://127.0.0.1:${toString cfg.api_ws.port}/";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
proxy_pass_header Authorization;
|
||||
'';
|
||||
};
|
||||
locations.${cfg.nginx.path_ui} = {
|
||||
proxyPass = "http://127.0.0.1:${builtins.toString cfg.ui.port}/";
|
||||
proxyPass = "http://127.0.0.1:${toString cfg.ui.port}/";
|
||||
extraConfig = ''
|
||||
proxy_pass_header Authorization;
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -105,12 +105,12 @@ in
|
|||
(toXmlAttrs { inherit (value) version; })
|
||||
{
|
||||
inherit (value) short description;
|
||||
port = builtins.map toXmlAttrs value.ports;
|
||||
protocol = builtins.map (mkXmlAttr "value") value.protocols;
|
||||
source-port = builtins.map toXmlAttrs value.sourcePorts;
|
||||
port = map toXmlAttrs value.ports;
|
||||
protocol = map (mkXmlAttr "value") value.protocols;
|
||||
source-port = map toXmlAttrs value.sourcePorts;
|
||||
destination = toXmlAttrs value.destination;
|
||||
include = builtins.map (mkXmlAttr "service") value.includes;
|
||||
helper = builtins.map (mkXmlAttr "name") value.helpers;
|
||||
include = map (mkXmlAttr "service") value.includes;
|
||||
helper = map (mkXmlAttr "name") value.helpers;
|
||||
}
|
||||
]
|
||||
);
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ in
|
|||
source = format.generate "firewalld-zone-${name}.xml" {
|
||||
zone =
|
||||
let
|
||||
mkXmlAttrList = name: builtins.map (mkXmlAttr name);
|
||||
mkXmlAttrList = name: map (mkXmlAttr name);
|
||||
mkXmlTag = value: if value then "" else null;
|
||||
in
|
||||
filterNullAttrs (
|
||||
|
|
@ -259,17 +259,17 @@ in
|
|||
(mkXmlAttr "egress-priority" value.egressPriority)
|
||||
{
|
||||
interface = mkXmlAttrList "name" value.interfaces;
|
||||
source = builtins.map toXmlAttrs value.sources;
|
||||
source = map toXmlAttrs value.sources;
|
||||
icmp-block-inversion = mkXmlTag value.icmpBlockInversion;
|
||||
forward = mkXmlTag value.forward;
|
||||
inherit (value) short description;
|
||||
service = mkXmlAttrList "name" value.services;
|
||||
port = builtins.map toXmlAttrs value.ports;
|
||||
port = map toXmlAttrs value.ports;
|
||||
protocol = mkXmlAttrList "value" value.protocols;
|
||||
icmp-block = mkXmlAttrList "name" value.icmpBlocks;
|
||||
masquerade = mkXmlTag value.masquerade;
|
||||
forward-port = builtins.map toXmlAttrs (builtins.map filterNullAttrs value.forwardPorts);
|
||||
source-port = builtins.map toXmlAttrs value.sourcePorts;
|
||||
forward-port = map toXmlAttrs (map filterNullAttrs value.forwardPorts);
|
||||
source-port = map toXmlAttrs value.sourcePorts;
|
||||
rule = value.rules;
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ let
|
|||
|
||||
signKeyPaths = cfg.signKeyPaths ++ lib.optional (cfg.signKeyPath != null) cfg.signKeyPath;
|
||||
credentials = lib.imap0 (i: signKeyPath: {
|
||||
id = "sign-key-${builtins.toString i}";
|
||||
id = "sign-key-${toString i}";
|
||||
path = signKeyPath;
|
||||
}) signKeyPaths;
|
||||
in
|
||||
|
|
@ -82,7 +82,7 @@ in
|
|||
DeviceAllow = [ "" ];
|
||||
UMask = "0066";
|
||||
RuntimeDirectory = "harmonia";
|
||||
LoadCredential = builtins.map (credential: "${credential.id}:${credential.path}") credentials;
|
||||
LoadCredential = map (credential: "${credential.id}:${credential.path}") credentials;
|
||||
SystemCallFilter = [
|
||||
"@system-service"
|
||||
"~@privileged"
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ let
|
|||
|
||||
inherit (pkgs.formats.yaml { }) type;
|
||||
};
|
||||
initrdInterfaceTypes = builtins.map (interface: interface.link.kind) (
|
||||
initrdInterfaceTypes = map (interface: interface.link.kind) (
|
||||
builtins.attrValues initrdCfg.settings.interfaces
|
||||
);
|
||||
# IfState interface kind to kernel modules mapping
|
||||
|
|
@ -228,7 +228,7 @@ in
|
|||
type:
|
||||
if builtins.hasAttr type interfaceKernelModules then interfaceKernelModules."${type}" else [ ];
|
||||
in
|
||||
lib.flatten (builtins.map enableModule initrdInterfaceTypes);
|
||||
lib.flatten (map enableModule initrdInterfaceTypes);
|
||||
|
||||
systemd = {
|
||||
storePaths = [
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ in
|
|||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
script = "exec ${pkgs.iodine}/bin/iodine -f -u ${iodinedUser} ${cfg.extraConfig} ${
|
||||
lib.optionalString (cfg.passwordFile != "") "< \"${builtins.toString cfg.passwordFile}\""
|
||||
lib.optionalString (cfg.passwordFile != "") "< \"${toString cfg.passwordFile}\""
|
||||
} ${cfg.relay} ${cfg.server}";
|
||||
serviceConfig = {
|
||||
RestartSec = "30s";
|
||||
|
|
@ -177,9 +177,7 @@ in
|
|||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
script = "exec ${pkgs.iodine}/bin/iodined -f -u ${iodinedUser} ${cfg.server.extraConfig} ${
|
||||
lib.optionalString (
|
||||
cfg.server.passwordFile != ""
|
||||
) "< \"${builtins.toString cfg.server.passwordFile}\""
|
||||
lib.optionalString (cfg.server.passwordFile != "") "< \"${toString cfg.server.passwordFile}\""
|
||||
} ${cfg.server.ip} ${cfg.server.domain}";
|
||||
serviceConfig = {
|
||||
# Filesystem access
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ in
|
|||
AmbientCapabilities = [
|
||||
"CAP_NET_BIND_SERVICE"
|
||||
];
|
||||
ExecStart = "${lib.getExe cfg.package} --port=${builtins.toString cfg.port} --fsdir=${cfg.dataDir} --config=${configFile} --verbose";
|
||||
ExecStart = "${lib.getExe cfg.package} --port=${toString cfg.port} --fsdir=${cfg.dataDir} --config=${configFile} --verbose";
|
||||
Restart = "always";
|
||||
RestartSec = "3";
|
||||
};
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue