···781781782782 # FIXME Most of these custom warnings and filters for security.acme.certs.* are required
783783 # because using mkRemovedOptionModule/mkChangedOptionModule with attrsets isn't possible.
784784- warnings = filter (w: w != "") (mapAttrsToList (cert: data: if data.extraDomains != "_mkMergedOptionModule" then ''
784784+ warnings = filter (w: w != "") (mapAttrsToList (cert: data: optionalString (data.extraDomains != "_mkMergedOptionModule") ''
785785 The option definition `security.acme.certs.${cert}.extraDomains` has changed
786786 to `security.acme.certs.${cert}.extraDomainNames` and is now a list of strings.
787787 Setting a custom webroot for extra domains is not possible, instead use separate certs.
788788- '' else "") cfg.certs);
788788+ '') cfg.certs);
789789790790 assertions = let
791791 certs = attrValues cfg.certs;
+2-2
nixos/modules/services/audio/snapserver.nix
···275275276276 warnings =
277277 # https://github.com/badaix/snapcast/blob/98ac8b2fb7305084376607b59173ce4097c620d8/server/streamreader/stream_manager.cpp#L85
278278- filter (w: w != "") (mapAttrsToList (k: v: if v.type == "spotify" then ''
278278+ filter (w: w != "") (mapAttrsToList (k: v: optionalString (v.type == "spotify") ''
279279 services.snapserver.streams.${k}.type = "spotify" is deprecated, use services.snapserver.streams.${k}.type = "librespot" instead.
280280- '' else "") cfg.streams);
280280+ '') cfg.streams);
281281282282 systemd.services.snapserver = {
283283 after = [ "network.target" ];
+1-1
nixos/modules/services/backup/mysql-backup.nix
···2020 '';
2121 backupDatabaseScript = db: ''
2222 dest="${cfg.location}/${db}.gz"
2323- if ${mariadb}/bin/mysqldump ${if cfg.singleTransaction then "--single-transaction" else ""} ${db} | ${gzip}/bin/gzip -c > $dest.tmp; then
2323+ if ${mariadb}/bin/mysqldump ${optionalString cfg.singleTransaction "--single-transaction"} ${db} | ${gzip}/bin/gzip -c > $dest.tmp; then
2424 mv $dest.tmp $dest
2525 echo "Backed up to $dest"
2626 else
···234234 ln -sfn ${tomcat}/conf/$i ${cfg.baseDir}/conf/`basename $i`
235235 done
236236237237- ${if cfg.extraConfigFiles != [] then ''
237237+ ${optionalString (cfg.extraConfigFiles != []) ''
238238 for i in ${toString cfg.extraConfigFiles}; do
239239 ln -sfn $i ${cfg.baseDir}/conf/`basename $i`
240240 done
241241- '' else ""}
241241+ ''}
242242243243 # Create a modified catalina.properties file
244244 # Change all references from CATALINA_HOME to CATALINA_BASE and add support for shared libraries
···345345346346 # Symlink all the given web applications files or paths into the webapps/ directory
347347 # of this virtual host
348348- for i in "${if virtualHost ? webapps then toString virtualHost.webapps else ""}"; do
348348+ for i in "${optionalString (virtualHost ? webapps) (toString virtualHost.webapps)}"; do
349349 if [ -f $i ]; then
350350 # If the given web application is a file, symlink it into the webapps/ directory
351351 ln -sfn $i ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps/`basename $i`
+2-2
nixos/modules/system/boot/loader/grub/grub.nix
···3333 then realGrub.override { efiSupport = cfg.efiSupport; }
3434 else null;
35353636- f = x: if x == null then "" else "" + x;
3636+ f = x: optionalString (x != null) ("" + x);
37373838 grubConfig = args:
3939 let
···5252 fullName = lib.getName realGrub;
5353 fullVersion = lib.getVersion realGrub;
5454 grubEfi = f grubEfi;
5555- grubTargetEfi = if cfg.efiSupport && (cfg.version == 2) then f (grubEfi.grubTarget or "") else "";
5555+ grubTargetEfi = optionalString (cfg.efiSupport && (cfg.version == 2)) (f (grubEfi.grubTarget or ""));
5656 bootPath = args.path;
5757 storePath = config.boot.loader.grub.storePath;
5858 bootloaderId = if args.efiBootloaderId == null then "${config.system.nixos.distroName}${efiSysMountPoint'}" else args.efiBootloaderId;
···319319 message = let
320320 fs = head (filter notAutoResizable fileSystems);
321321 in
322322- "Mountpoint '${fs.mountPoint}': 'autoResize = true' is not supported for 'fsType = \"${fs.fsType}\"':${if fs.fsType == "auto" then " fsType has to be explicitly set and" else ""} only the ext filesystems and f2fs support it.";
322322+ "Mountpoint '${fs.mountPoint}': 'autoResize = true' is not supported for 'fsType = \"${fs.fsType}\"':${optionalString (fs.fsType == "auto") " fsType has to be explicitly set and"} only the ext filesystems and f2fs support it.";
323323 }
324324 ];
325325