Change:
The most recent for davfs2 adds an (equal sign) between keys/values in should be According to the man page: This causes the following error : Steps to reproduce the behavior: in systemd mount: `/etc/davfs2/secrets file using sops-nix or creating the file. Except to see the webdav mount successfully mounted at /mnt/nextcloud without any log errors. N/A Just looks like an inadvertent change in the latest PR. Please run and paste the result.

Discussion:
{ config, lib, pkgs, ... }: <del> with lib; </del> let <del> toStr = value: if true == value then "yes" else if false == value then "no" else toString value; </del> <ins> inherit (lib.attrsets) optionalAttrs; inherit (lib.generators) toINIWithGlobalSection; inherit (lib.lists) optional; inherit (lib.modules) mkIf; inherit (lib.options) literalExpression mkEnableOption mkOption; inherit (lib.strings) escape; inherit (lib.types) attrsOf bool int lines oneOf str submodule; </ins> cfg = config.services.davfs2; <del> format = pkgs.formats.toml { }; configFile = let settings = mapAttrsToList (n: v: "${n} = ${toStr v}") cfg.settings; in pkgs.writeText "davfs2.conf" '' ${concatStringsSep "n" settings} ${cfg.extraConfig} ''; </del> <ins> escapeString = escape [""" ""]; formatValue = value: if true == value then "1" else if false == value then "0" else if builtins.isString value then ""${escapeString value}"" else toString value; configFile = pkgs.writeText "davfs2.conf" ( if (cfg.settings != { }) then (toINIWithGlobalSection { mkSectionName = escapeString; mkKeyValue = k: v: "${k} ${formatValue v}"; } cfg.settings) else cfg.extraConfig ); </ins> in { options.services.davfs2 = { <del> enable = mkOption { type = types.bool; default = false; description = lib.mdDoc '' Whether to enable davfs2. ''; }; </del> <ins> enable = mkEnableOption "davfs2"; </ins> davUser = mkOption { <del> type = types.str; </del> <ins> type = str; </ins> default = "davfs2"; <del> description = lib.mdDoc '' </del> <ins> description = '' </ins> When invoked by root the mount.davfs daemon will run as this user. Value must be given as name, not as numerical id. ''; }; davGroup = mkOption { <del> type = types.str; </del> <ins> type = str; </ins> default = "davfs2"; <del> description = lib.mdDoc '' </del> <ins> description = '' </ins> The group of the running mount.davfs daemon. Ordinary users must be member of this group in order to mount a davfs2 file system. Value must be given as name, not as numerical id.

}; extraConfig = mkOption { <del> type = types.lines; </del> <ins> type = lines; </ins> default = ""; example = '' <del> kernel_fs coda </del> proxy foo.bar:8080 use_locks 0 <ins> [/media/dav] use_locks 1 [/home/otto/mywebspace] gui_optimize 1 </ins> ''; <del> description = lib.mdDoc '' </del> <ins> description = '' </ins> Extra lines appended to the configuration of davfs2. See {manpage}`davfs2.conf(5)` for available settings.

}; settings = mkOption { <del> type = types.submodule { freeformType = format.type; </del> <ins> type = submodule { freeformType = let valueTypes = [ bool int str ]; in attrsOf (attrsOf (oneOf (valueTypes ++ [ (attrsOf (oneOf valueTypes)) ] ))); </ins> }; <del> default = {}; </del> <ins> default = { }; </ins> example = literalExpression '' { <del> kernel_fs = "coda"; proxy = "foo.bar:8080"; use_locks = 0; </del> <ins> globalSection = { proxy = "foo.bar:8080"; use_locks = false; }; sections = { "/media/dav" = { use_locks = true; }; "/home/otto/mywebspace" = { gui_optimize = true; }; }; </ins> } ''; <del> description = lib.mdDoc '' </del> <ins> description = '' </ins> Extra settings appended to the configuration of davfs2. See {manpage}`davfs2.conf(5)` for available settings. ''  ;

config = mkIf cfg.enable { <del> warnings = lib.optional (cfg.extraConfig != null) '' services.davfs2.extraConfig will be deprecated in future releases, please use the settings option now. </del> <ins> assertions = [ { assertion = cfg.extraConfig != "" -> cfg.settings == { }; message = '' services.davfs2.extraConfig and services.davfs2.settings cannot be used together. Please prefer using services.davfs2.settings. ''; } ]; warnings = optional (cfg.extraConfig != "") '' services.davfs2.extraConfig will be deprecated in future releases; please use services.davfs2.settings instead. </ins> ''; environment.systemPackages = [ pkgs.davfs2 ]; environment.etc."davfs2/davfs2.conf".source = configFile; services.davfs2.settings = { <del> dav_user = cfg.davUser; dav_group = cfg.davGroup; </del> <ins> globalSection = { dav_user = cfg.davUser; dav_group = cfg.davGroup; }; </ins> }; users.groups = optionalAttrs (cfg.davGroup == "davfs2") {