Trying to get backups working with a webdav remote using restic + rclone

I am trying to use the restic service with an rclone configuration to run daily backups to a webdav remote.

Here’s what I have in my configuration.nix:

services.restic = { 
  backups.varlib = { 
    initialize = true;
    repository = "rclone:stackstorage:${config.networking.hostName}";
    paths = [ "/var/lib" ];
    passwordFile = "/etc/nixos/secrets/restic_password.txt";
    rcloneConfig = { 
      type = "webdav";
      vendor = "owncloud";
      url = secrets.stackstorage.url;
      user = secrets.stackstorage.user;
      pass = secrets.stackstorage.password;
    };
    pruneOpts = [ 
      "--keep-weekly 4"
      "--keep-monthly 3"
    ];
  };
};

When the service runs, it fails to find the rclone configuration:

Mar 12 09:18:50 ensbo restic-backups-varlib-pre-start[8244]: rclone: <5>NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
Mar 12 09:18:50 ensbo restic-backups-varlib-pre-start[8244]: rclone: Failed to create file system for "stackstorage:ensbo": read metadata failed: 401 Unauthorized: 401 Unauthorized
Mar 12 09:18:50 ensbo restic-backups-varlib-pre-start[8244]: Fatal: unable to open repository at rclone:stackstorage:ensbo: error talking HTTP to rclone: context canceled
Mar 12 09:18:50 ensbo restic-backups-varlib-pre-start[8263]: rclone: <5>NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
Mar 12 09:18:50 ensbo restic-backups-varlib-pre-start[8263]: rclone: Failed to create file system for "stackstorage:ensbo": read metadata failed: 401 Unauthorized: 401 Unauthorized
Mar 12 09:18:50 ensbo restic-backups-varlib-pre-start[8263]: Fatal: create repository at rclone:stackstorage:ensbo failed: error talking HTTP to rclone: context canceled
Mar 12 09:18:50 ensbo systemd[1]: restic-backups-varlib.service: Control process exited, code=exited, status=1/FAILURE

What am I missing?

# nix-info
system: "x86_64-linux", multi-user?: yes, version: nix-env (Nix) 2.11.1, channels(root): "nixos-22.11-small"

I was able to solve this my moving the rclone configuration into a file and then setting rcloneConfigFile instead of rcloneConfig.

I filed an issue since this seems to indicate a bug in the restic service: nixos/restic: rcloneConfig not applied if there is no rcloneConfigFile · Issue #220869 · NixOS/nixpkgs · GitHub

Never mind, it was not a bug.