mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
treewide: De-inline uses of lib.boolToString
This commit should not change eval results
This commit is contained in:
parent
74d875206a
commit
cebf9198f3
20 changed files with 30 additions and 28 deletions
|
@ -153,7 +153,7 @@ let
|
|||
|
||||
${concatStringsSep "\n" (mapAttrsToList (name: value: let
|
||||
includeName = if name == "rspamd_proxy" then "proxy" else name;
|
||||
tryOverride = if value.extraConfig == "" then "true" else "false";
|
||||
tryOverride = boolToString (value.extraConfig == "");
|
||||
in ''
|
||||
worker "${value.type}" {
|
||||
type = "${value.type}";
|
||||
|
|
|
@ -45,7 +45,7 @@ let
|
|||
trusted-substituters = ${toString cfg.trustedBinaryCaches}
|
||||
trusted-public-keys = ${toString cfg.binaryCachePublicKeys}
|
||||
auto-optimise-store = ${boolToString cfg.autoOptimiseStore}
|
||||
require-sigs = ${if cfg.requireSignedBinaryCaches then "true" else "false"}
|
||||
require-sigs = ${boolToString cfg.requireSignedBinaryCaches}
|
||||
trusted-users = ${toString cfg.trustedUsers}
|
||||
allowed-users = ${toString cfg.allowedUsers}
|
||||
${optionalString (!cfg.distributedBuilds) ''
|
||||
|
|
|
@ -261,7 +261,7 @@ let
|
|||
|
||||
toLua = x:
|
||||
if builtins.isString x then ''"${x}"''
|
||||
else if builtins.isBool x then (if x == true then "true" else "false")
|
||||
else if builtins.isBool x then boolToString x
|
||||
else if builtins.isInt x then toString x
|
||||
else if builtins.isList x then ''{ ${lib.concatStringsSep ", " (map (n: toLua n) x) } }''
|
||||
else throw "Invalid Lua value";
|
||||
|
|
|
@ -282,12 +282,12 @@ in
|
|||
services.fail2ban.jails.DEFAULT = ''
|
||||
${optionalString cfg.bantime-increment.enable ''
|
||||
# Bantime incremental
|
||||
bantime.increment = ${if cfg.bantime-increment.enable then "true" else "false"}
|
||||
bantime.increment = ${boolToString cfg.bantime-increment.enable}
|
||||
bantime.maxtime = ${cfg.bantime-increment.maxtime}
|
||||
bantime.factor = ${cfg.bantime-increment.factor}
|
||||
bantime.formula = ${cfg.bantime-increment.formula}
|
||||
bantime.multipliers = ${cfg.bantime-increment.multipliers}
|
||||
bantime.overalljails = ${if cfg.bantime-increment.overalljails then "true" else "false"}
|
||||
bantime.overalljails = ${boolToString cfg.bantime-increment.overalljails}
|
||||
''}
|
||||
# Miscellaneous options
|
||||
ignoreip = 127.0.0.1/8 ${optionalString config.networking.enableIPv6 "::1"} ${concatStringsSep " " cfg.ignoreIP}
|
||||
|
|
|
@ -19,13 +19,13 @@ let
|
|||
PresentDevicePolicy=${cfg.presentDevicePolicy}
|
||||
PresentControllerPolicy=${cfg.presentControllerPolicy}
|
||||
InsertedDevicePolicy=${cfg.insertedDevicePolicy}
|
||||
RestoreControllerDeviceState=${if cfg.restoreControllerDeviceState then "true" else "false"}
|
||||
RestoreControllerDeviceState=${boolToString cfg.restoreControllerDeviceState}
|
||||
# this does not seem useful for endusers to change
|
||||
DeviceManagerBackend=uevent
|
||||
IPCAllowedUsers=${concatStringsSep " " cfg.IPCAllowedUsers}
|
||||
IPCAllowedGroups=${concatStringsSep " " cfg.IPCAllowedGroups}
|
||||
IPCAccessControlFiles=/var/lib/usbguard/IPCAccessControl.d/
|
||||
DeviceRulesWithPort=${if cfg.deviceRulesWithPort then "true" else "false"}
|
||||
DeviceRulesWithPort=${boolToString cfg.deviceRulesWithPort}
|
||||
# HACK: that way audit logs still land in the journal
|
||||
AuditFilePath=/dev/null
|
||||
'';
|
||||
|
|
|
@ -264,7 +264,7 @@ in
|
|||
# presented and there's a little delay.
|
||||
environment.etc."gdm/custom.conf".text = ''
|
||||
[daemon]
|
||||
WaylandEnable=${if cfg.gdm.wayland then "true" else "false"}
|
||||
WaylandEnable=${boolToString cfg.gdm.wayland}
|
||||
${optionalString cfg.autoLogin.enable (
|
||||
if cfg.gdm.autoLogin.delay > 0 then ''
|
||||
TimedLoginEnable=true
|
||||
|
|
|
@ -55,10 +55,10 @@ let
|
|||
XauthPath=${pkgs.xorg.xauth}/bin/xauth
|
||||
DisplayCommand=${Xsetup}
|
||||
DisplayStopCommand=${Xstop}
|
||||
EnableHidpi=${if cfg.enableHidpi then "true" else "false"}
|
||||
EnableHidpi=${boolToString cfg.enableHidpi}
|
||||
|
||||
[Wayland]
|
||||
EnableHidpi=${if cfg.enableHidpi then "true" else "false"}
|
||||
EnableHidpi=${boolToString cfg.enableHidpi}
|
||||
SessionDir=${dmcfg.sessionData.desktops}/share/wayland-sessions
|
||||
|
||||
${optionalString dmcfg.autoLogin.enable ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue