git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/radicale: use radicale3
commitd77fb3729dbad2a38e36d3b5726813866f43b545 authorRobert Schütz <dev@schuetz-co.de> dateSat 20 Jun 2020, 14:30 (6 years ago) parent45bf775
3 files changed+40−9
nixos/doc/manual/release-notes/rl-2009.xml+10 nixos/modules/services/networking/radicale.nix+7−4 nixos/tests/radicale.nix+23−5
nixos/doc/manual/release-notes/rl-2009.xml+10
@@ -495,6 +495,16 @@ systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/var/www" ];
495495 In the <literal>resilio</literal> module, <xref linkend="opt-services.resilio.httpListenAddr"/> has been changed to listen to <literal>[::1]</literal> instead of <literal>0.0.0.0</literal>.
496496 </para>
497497 </listitem>
498+ <listitem>
499+ <para>
500+ Radicale's default package has changed from 2.x to 3.x. An upgrade
501+ checklist can be found
502+ <link xlink:href="https://github.com/Kozea/Radicale/blob/3.0.x/NEWS.md#upgrade-checklist">here</link>.
503+ You can use the newer version in the NixOS service by setting the
504+ <literal>package</literal> to <literal>radicale3</literal>, which is done
505+ automatically if <literal>stateVersion</literal> is 20.09 or higher.
506+ </para>
507+ </listitem>
498508 </itemizedlist>
499509 </section>
500510
nixos/modules/services/networking/radicale.nix+7−4
@@ -8,8 +8,10 @@ let
88
99 confFile = pkgs.writeText "radicale.conf" cfg.config;
1010
11− # This enables us to default to version 2 while still not breaking configurations of people with version 1
12− defaultPackage = if versionAtLeast config.system.stateVersion "17.09" then {
11+ defaultPackage = if versionAtLeast config.system.stateVersion "20.09" then {
12+ pkg = pkgs.radicale3;
13+ text = "pkgs.radicale3";
14+ } else if versionAtLeast config.system.stateVersion "17.09" then {
1315 pkg = pkgs.radicale2;
1416 text = "pkgs.radicale2";
1517 } else {
@@ -35,8 +37,9 @@ in
3537 defaultText = defaultPackage.text;
3638 description = ''
3739 Radicale package to use. This defaults to version 1.x if
38− <literal>system.stateVersion &lt; 17.09</literal> and version 2.x
39− otherwise.
40+ <literal>system.stateVersion &lt; 17.09</literal>, version 2.x if
41+ <literal>17.09 ≤ system.stateVersion &lt; 20.09</literal>, and
42+ version 3.x otherwise.
4043 '';
4144 };
4245
nixos/tests/radicale.nix+23−5
@@ -14,9 +14,6 @@ let
1414
1515 [storage]
1616 filesystem_folder = /tmp/collections
17−
18− [logging]
19− debug = True
2017 '';
2118 };
2219 # WARNING: DON'T DO THIS IN PRODUCTION!
@@ -49,13 +46,18 @@ in
4946 services.radicale.extraArgs = [
5047 "--export-storage" "/tmp/collections-new"
5148 ];
49+ system.stateVersion = "17.03";
5250 };
5351 radicale2_verify = lib.recursiveUpdate radicale2 {
54− services.radicale.extraArgs = [ "--verify-storage" ];
52+ services.radicale.extraArgs = [ "--debug" "--verify-storage" ];
53+ system.stateVersion = "17.09";
5554 };
5655 radicale2 = lib.recursiveUpdate (common args) {
5756 system.stateVersion = "17.09";
5857 };
58+ radicale3 = lib.recursiveUpdate (common args) {
59+ system.stateVersion = "20.09";
60+ };
5961 };
6062
6163 # This tests whether the web interface is accessible to an authenticated user
@@ -117,6 +119,22 @@ in
117119 retcode == 0 and "VCALENDAR" in output
118120 ), "Could not read calendar from Radicale 2"
119121
120− radicale.succeed("curl --fail http://${user}:${password}@localhost:${port}/.web/")
122+ radicale.succeed("curl --fail http://${user}:${password}@localhost:${port}/.web/")
123+
124+ with subtest("Check Radicale 3 functionality"):
125+ radicale.succeed(
126+ "${switchToConfig "radicale3"} >&2"
127+ )
128+ radicale.wait_for_unit("radicale.service")
129+ radicale.wait_for_open_port(${port})
130+
131+ (retcode, output) = radicale.execute(
132+ "curl --fail http://${user}:${password}@localhost:${port}/someuser/calendar.ics/"
133+ )
134+ assert (
135+ retcode == 0 and "VCALENDAR" in output
136+ ), "Could not read calendar from Radicale 3"
137+
138+ radicale.succeed("curl --fail http://${user}:${password}@localhost:${port}/.web/")
121139 '';
122140})