nixpkgs/nixos/modules/services/networking/radicale.nix

47 lines
975 B
Nix
Raw Normal View History

2014-05-27 22:27:31 +02:00
{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 ];
2016-01-06 07:50:18 +01:00
systemd.services.radicale = {
2014-05-27 22:27:31 +02:00
description = "A Simple Calendar and Contact Server";
2016-01-06 07:50:18 +01:00
after = [ "network-interfaces.target" ];
wantedBy = [ "multi-user.target" ];
script = "${pkgs.pythonPackages.radicale}/bin/radicale -C ${confFile} -d";
serviceConfig.Type = "forking";
2014-05-27 22:27:31 +02:00
};
};
}