mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
services/pimsync: init
services/pimsync: add documentation
This commit is contained in:
parent
2b0a46285b
commit
c3a5e5f0df
1 changed files with 67 additions and 0 deletions
67
modules/services/pimsync.nix
Normal file
67
modules/services/pimsync.nix
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.services.pimsync;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
meta.maintainers = [ lib.maintainers.antonmosich ];
|
||||||
|
|
||||||
|
options.services.pimsync = {
|
||||||
|
enable = lib.mkEnableOption "pimsync";
|
||||||
|
|
||||||
|
package = lib.mkPackageOption pkgs "pimsync" { };
|
||||||
|
|
||||||
|
configFile = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.path;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Optional configuration file to use instead of the default file
|
||||||
|
({file}`$XDG_CONFIG_HOME/pimsync/pimsync.conf`).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
verbosity = lib.mkOption {
|
||||||
|
type = lib.types.enum [
|
||||||
|
"trace"
|
||||||
|
"debug"
|
||||||
|
"info"
|
||||||
|
"warn"
|
||||||
|
"error"
|
||||||
|
];
|
||||||
|
description = "The verbosity in which pimsync should log.";
|
||||||
|
default = "warn";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
systemd.user.services.pimsync = {
|
||||||
|
Unit = {
|
||||||
|
Description = "pimsync calendar and contacts synchronization";
|
||||||
|
PartOf = [ "network-online.target" ];
|
||||||
|
};
|
||||||
|
Service = {
|
||||||
|
# TODO: make use of the readiness notification
|
||||||
|
Type = "simple";
|
||||||
|
|
||||||
|
ExecStart =
|
||||||
|
let
|
||||||
|
command = [
|
||||||
|
(lib.getExe cfg.package)
|
||||||
|
"-v"
|
||||||
|
cfg.verbosity
|
||||||
|
]
|
||||||
|
++ lib.optionals (cfg.configFile != null) [
|
||||||
|
"-c"
|
||||||
|
cfg.configFile
|
||||||
|
]
|
||||||
|
++ [ "daemon" ];
|
||||||
|
in
|
||||||
|
lib.concatStringsSep " " command;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue