summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2023-04-30 01:52:10 +0200
committerGitHub <noreply@github.com>2023-04-30 01:52:10 +0200
commit5d0d352833c5d52244c51b1b8a83265777581610 (patch)
treeb957d7720b50f99331b1484583dcdfcbcb0ceeb9 /nixos
parentd660a6a62a10fcb0c2fa2be1cec394b44ba3a8ab (diff)
parentacfed642249887ce8b5a0401e0bfcdb864622a06 (diff)
downloadnixpkgs-5d0d352833c5d52244c51b1b8a83265777581610.tar
nixpkgs-5d0d352833c5d52244c51b1b8a83265777581610.tar.gz
nixpkgs-5d0d352833c5d52244c51b1b8a83265777581610.tar.bz2
nixpkgs-5d0d352833c5d52244c51b1b8a83265777581610.tar.lz
nixpkgs-5d0d352833c5d52244c51b1b8a83265777581610.tar.xz
nixpkgs-5d0d352833c5d52244c51b1b8a83265777581610.tar.zst
nixpkgs-5d0d352833c5d52244c51b1b8a83265777581610.zip
Merge pull request #220761 from elesiuta/picosnitch-init
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/networking/picosnitch.nix26
2 files changed, 27 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 3932e903302..79f54865879 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -961,6 +961,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 00000000000..c9b38c1929c
--- /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";
+      };
+    };
+  };
+}