summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/networking/picosnitch.nix
blob: 841e05bdd62d592996e3f3bcfa76ac0e23cdaf71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
  config,
  lib,
  pkgs,
  ...
}:

with lib;

let
  cfg = config.services.picosnitch;
in
{
  options.services.picosnitch = {
    enable = mkEnableOption "picosnitch daemon";
  };
  config = mkIf cfg.enable {
    environment.systemPackages = [ pkgs.picosnitch ];
    systemd.services.picosnitch = {
      description = "picosnitch";
      wantedBy = [ "multi-user.target" ];
      serviceConfig = {
        Type = "simple";
        Restart = "always";
        RestartSec = 5;
        ExecStart = "${pkgs.picosnitch}/bin/picosnitch start-no-daemon";
        PIDFile = "/run/picosnitch/picosnitch.pid";
      };
    };
  };
}