587713944a
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
26 lines
617 B
Nix
26 lines
617 B
Nix
{ 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";
|
|
};
|
|
};
|
|
};
|
|
}
|