about summary refs log tree commit diff
path: root/nixos/modules/services/networking/radicale.nix
diff options
context:
space:
mode:
authorEdward Tjörnhammar <ed@cflags.cc>2014-05-27 22:27:31 +0200
committerEdward Tjörnhammar <ed@cflags.cc>2014-05-28 20:41:39 +0200
commitd1277ddcc2aa009d05b7b6e3fbaa72262516b3ec (patch)
treec45d0c4ec408319fad4cc1d21543d451a3ce834b /nixos/modules/services/networking/radicale.nix
parenta7d6947343af62282b1048a7cb74f7c0021ecddc (diff)
downloadnixlib-d1277ddcc2aa009d05b7b6e3fbaa72262516b3ec.tar
nixlib-d1277ddcc2aa009d05b7b6e3fbaa72262516b3ec.tar.gz
nixlib-d1277ddcc2aa009d05b7b6e3fbaa72262516b3ec.tar.bz2
nixlib-d1277ddcc2aa009d05b7b6e3fbaa72262516b3ec.tar.lz
nixlib-d1277ddcc2aa009d05b7b6e3fbaa72262516b3ec.tar.xz
nixlib-d1277ddcc2aa009d05b7b6e3fbaa72262516b3ec.tar.zst
nixlib-d1277ddcc2aa009d05b7b6e3fbaa72262516b3ec.zip
Adding Radicale package and service
Diffstat (limited to 'nixos/modules/services/networking/radicale.nix')
-rw-r--r--nixos/modules/services/networking/radicale.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/radicale.nix b/nixos/modules/services/networking/radicale.nix
new file mode 100644
index 000000000000..fc9afc70aca4
--- /dev/null
+++ b/nixos/modules/services/networking/radicale.nix
@@ -0,0 +1,48 @@
+{config, lib, pkgs, ...}:
+
+with lib;
+
+let
+
+  cfg = config.services.radicale;
+
+  confFile = pkgs.writeText "radicale.conf" cfg.config;
+
+in
+
+{
+
+  options = {
+
+    services.radicale.enable = mkOption {
+      type = types.bool;
+      default = false;
+      description = ''
+          Enable Radicale CalDAV and CardDAV server
+      '';
+    };
+
+    services.radicale.config = mkOption {
+      type = types.string;
+      default = "";
+      description = ''
+        Radicale configuration, this will set the service
+        configuration file
+      '';
+      };
+  };
+
+  config = mkIf cfg.enable {
+
+    environment.systemPackages = [ pkgs.pythonPackages.radicale ];
+
+    jobs.radicale = {
+      description = "A Simple Calendar and Contact Server";
+      startOn = "started network-interfaces";
+      exec = "${pkgs.pythonPackages.radicale}/bin/radicale -C ${confFile} -d";
+      daemonType = "fork";
+    };
+
+  };
+
+}