2023-10-09 19:29:22 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.services.netclient;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
meta.maintainers = with lib.maintainers; [ wexder ];
|
|
|
|
|
|
|
|
options.services.netclient = {
|
|
|
|
enable = lib.mkEnableOption (lib.mdDoc "Netclient Daemon");
|
2024-01-02 11:29:13 +00:00
|
|
|
package = lib.mkPackageOption pkgs "netclient" { };
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
systemd.services.netclient = {
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
after = [ "network-online.target" ];
|
|
|
|
description = "Netclient Daemon";
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
|
|
|
ExecStart = "${lib.getExe cfg.package} daemon";
|
|
|
|
Restart = "on-failure";
|
|
|
|
RestartSec = "15s";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|