depot/third_party/nixpkgs/nixos/modules/services/networking/picosnitch.nix
Default email 94427deb9d Project import generated by Copybara.
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
2023-05-24 16:37:59 +03:00

26 lines
629 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.picosnitch;
in
{
options.services.picosnitch = {
enable = mkEnableOption (lib.mdDoc "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";
};
};
};
}