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