Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
27 lines
706 B
Nix
27 lines
706 B
Nix
{ config, pkgs, lib, ... }:
|
|
let
|
|
cfg = config.services.netclient;
|
|
in
|
|
{
|
|
meta.maintainers = with lib.maintainers; [ wexder ];
|
|
|
|
options.services.netclient = {
|
|
enable = lib.mkEnableOption "Netclient Daemon";
|
|
package = lib.mkPackageOption pkgs "netclient" { };
|
|
};
|
|
|
|
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";
|
|
};
|
|
};
|
|
};
|
|
}
|