2023-07-18 21:27:34 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.services.netclient;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
meta.maintainers = with lib.maintainers; [ wexder ];
|
|
|
|
|
|
|
|
options.services.netclient = {
|
2024-04-13 12:54:15 +00:00
|
|
|
enable = lib.mkEnableOption "Netclient Daemon";
|
2023-11-30 18:03:14 +00:00
|
|
|
package = lib.mkPackageOption pkgs "netclient" { };
|
2023-07-18 21:27:34 +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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|