]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/tasks/default.nix
Migrate php sessions to redis
[perso/Immae/Config/Nix.git] / modules / private / tasks / default.nix
index 64802550ac73a8e9591a1d76dd414daba66d1715..c9144713f4175f539214e018d368f742cae87424 100644 (file)
@@ -86,6 +86,28 @@ in {
   };
 
   config = lib.mkIf cfg.enable {
+    myServices.chatonsProperties.services.taskwarrior = {
+      file.datetime = "2022-08-22T00:00:00";
+      service = {
+        name = "Taskwarrior";
+        description = "Taskwarrior is Free and Open Source Software that manages your TODO list from the command line. Web interface and synchronization server";
+        website = "https://task.immae.eu/";
+        logo = "https://taskwarrior.org/favicon.ico";
+        status.level = "OK";
+        status.description = "OK";
+        registration."" = ["MEMBER" "CLIENT"];
+        registration.load = "OPEN";
+        install.type = "PACKAGE";
+      };
+      software = {
+        name = "Taskwarrior";
+        website = "https://taskwarrior.org/";
+        license.url = "https://github.com/GothenburgBitFactory/taskwarrior/blob/develop/LICENSE";
+        license.name = "MIT License";
+        version = pkgs.webapps.taskwarrior-web.version;
+        source.url = "https://taskwarrior.org/download/";
+      };
+    };
     secrets.keys = {
       "webapps/tools-taskwarrior-web" = {
         user = "wwwrun";
@@ -225,17 +247,19 @@ in {
 
           # Needed to avoid clashes in browser cookies (same domain)
           "php_value[session.name]" = "TaskPHPSESSID";
+          "php_admin_value[session.save_handler]" = "redis";
+          "php_admin_value[session.save_path]" = "'unix:///run/redis-php-sessions/redis.sock?persistent=1&prefix=Tools:Task:'";
           "php_admin_value[open_basedir]" = "${./www}:/tmp:${server_vardir}:/etc/profiles/per-user/${user}/bin/";
         };
         phpEnv = {
           PATH = "/etc/profiles/per-user/${user}/bin";
         };
-        phpPackage = pkgs.php72;
+        phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [ all.redis ]);
       };
     };
 
     security.acme.certs."task" = config.myServices.certificates.certConfig // {
-      inherit user group;
+      inherit group;
       domain = fqdn;
       postRun = ''
         systemctl restart taskserver.service