Confused about how to set up Radicale with InfCloud

Basically the title. I’ve got Radicale up and running:

services.radicale = {
    enable = true;
    settings.auth = {
      type = "htpasswd";
      htpasswd_filename = builtins.toString htpasswd;
      htpasswd_encryption = "bcrypt";
    };
  };

plus nginx as a reverse proxy. No problems at all with this.

But I do not understand how to now make use of the python312Packages.radicale-infcloud package available from nixpgs. Just adding it as a system package does not work, additionally setting

services.radicale.settings.web = {
  type = "radicale_infcloud";
};

generates the config that is shown in the projects GitHub README, but radicale.service fails with

Failed to load web module 'radicale_infcloud': No module named 'radicale_infcloud'

Fairly sure this is just me coming up against another Nix knowledge gap of mine, but I’d really appreciate some help :smile:

Hi, this is the config that I’m using. Hope it helps.

{ config, pkgs, lib, ... }: {

  services.radicale = {
    enable = true;
    settings = {                                    
      auth = {                                      
        type = "htpasswd";            
        # For updating/creating passwords:                                                               
        # sudo -u radicale htpasswd -bB /var/lib/radicale/users <username> <newpassword>
        htpasswd_filename = "/var/lib/radicale/users";            
        # encryption method used in the htpasswd file
        htpasswd_encryption = "bcrypt";
      };    
                          
      server.hosts = [ "[::]:8080" ];
      storage.filesystem_folder = "/var/lib/radicale/collections";
      web = {                                                                                            
        type = "radicale_infcloud";
        # The weird spacing here is on purpose to hack the INI formatter...
        infcloud_config = ''
          globalInterfaceLanguage = "de_DE";
                          globalTimeZone = "Europe/Berlin";
        '';                                         
      };          
    };     
  };                                                
                                                    
  systemd.services.radicale.environment.PYTHONPATH = 
    let    
      python = pkgs.python3.withPackages (ps: with ps; [
        radicale_infcloud
        pytz                                                                                             
        setuptools  
      ]);
    in
    "${python}/${pkgs.python3.sitePackages}";
}
2 Likes

Ah, awesome! Thank you!