1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8with lib;
9
10let
11 cfg = config.services.picosnitch;
12in
13{
14 options.services.picosnitch = {
15 enable = mkEnableOption "picosnitch daemon";
16 };
17 config = mkIf cfg.enable {
18 environment.systemPackages = [ pkgs.picosnitch ];
19 systemd.services.picosnitch = {
20 description = "picosnitch";
21 wantedBy = [ "multi-user.target" ];
22 serviceConfig = {
23 Type = "simple";
24 Restart = "always";
25 RestartSec = 5;
26 ExecStart = "${pkgs.picosnitch}/bin/picosnitch start-no-daemon";
27 PIDFile = "/run/picosnitch/picosnitch.pid";
28 };
29 };
30 };
31}