0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-19 08:31:01 +03:00
nixpkgs/nixos/modules/services/networking/picosnitch.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
625 B
Nix
Raw Normal View History

2023-04-14 22:09:48 -04:00
{
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";
};
};
};
}