2024-12-10 20:29:24 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2023-04-14 22:09:48 -04:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.picosnitch;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.services.picosnitch = {
|
2024-04-13 14:54:15 +02:00
|
|
|
enable = mkEnableOption "picosnitch daemon";
|
2023-04-14 22:09:48 -04:00
|
|
|
};
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|