From acfed642249887ce8b5a0401e0bfcdb864622a06 Mon Sep 17 00:00:00 2001 From: Eric Lesiuta Date: Fri, 14 Apr 2023 22:09:48 -0400 Subject: [PATCH] nixos/picosnitch: init --- nixos/modules/module-list.nix | 1 + .../services/networking/picosnitch.nix | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 nixos/modules/services/networking/picosnitch.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index bac096efac2c..08b9100ea0fd 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -955,6 +955,7 @@ ./services/networking/pdns-recursor.nix ./services/networking/pdnsd.nix ./services/networking/peroxide.nix + ./services/networking/picosnitch.nix ./services/networking/pixiecore.nix ./services/networking/pleroma.nix ./services/networking/polipo.nix diff --git a/nixos/modules/services/networking/picosnitch.nix b/nixos/modules/services/networking/picosnitch.nix new file mode 100644 index 000000000000..c9b38c1929ca --- /dev/null +++ b/nixos/modules/services/networking/picosnitch.nix @@ -0,0 +1,26 @@ +{ 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"; + }; + }; + }; +}