mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 06:31:02 +00:00
49 lines
910 B
Nix
49 lines
910 B
Nix
|
{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";
|
||
|
};
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|