mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
treewide: use more lib.optionalString
This commit is contained in:
parent
b392d9b827
commit
327b0cff7a
41 changed files with 89 additions and 95 deletions
|
@ -4,7 +4,7 @@ let
|
|||
|
||||
inherit (builtins) toFile;
|
||||
inherit (lib) concatMapStringsSep concatStringsSep mapAttrsToList
|
||||
mkIf mkEnableOption mkOption types literalExpression;
|
||||
mkIf mkEnableOption mkOption types literalExpression optionalString;
|
||||
|
||||
cfg = config.services.strongswan;
|
||||
|
||||
|
@ -34,8 +34,8 @@ let
|
|||
|
||||
strongswanConf = {setup, connections, ca, secretsFile, managePlugins, enabledPlugins}: toFile "strongswan.conf" ''
|
||||
charon {
|
||||
${if managePlugins then "load_modular = no" else ""}
|
||||
${if managePlugins then ("load = " + (concatStringsSep " " enabledPlugins)) else ""}
|
||||
${optionalString managePlugins "load_modular = no"}
|
||||
${optionalString managePlugins ("load = " + (concatStringsSep " " enabledPlugins))}
|
||||
plugins {
|
||||
stroke {
|
||||
secrets_file = ${secretsFile}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue