mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-17 03:03:37 +00:00
28 lines
720 B
Nix
28 lines
720 B
Nix
{ 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");
|
|
package = lib.mkPackageOptionMD 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";
|
|
};
|
|
};
|
|
};
|
|
}
|