mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 02:03:01 +00:00
27 lines
629 B
Nix
27 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";
|
|
};
|
|
};
|
|
};
|
|
}
|