My Nix Configuration

[modules.nixos] remove dn42-pingfinder service

pyrox.dev 0a4876f1 ae3325e0

verified
Changed files
-51
modules
nixos
services
dn42-pingfinder
-51
modules/nixos/services/dn42-pingfinder/default.nix
···
-
{
-
config,
-
pkgs,
-
lib,
-
...
-
}:
-
let
-
cfg = config.py.services.dn42-pingfinder;
-
in
-
{
-
options.py.services.dn42-pingfinder = {
-
uuidFile = lib.mkOption {
-
type = lib.types.nullOr lib.types.path;
-
default = null;
-
description = "UUID of the pingfinder service";
-
};
-
};
-
-
config = lib.mkIf (cfg.uuidFile != null) {
-
systemd.services.dn42-pingfinder = {
-
path = with pkgs; [
-
curl
-
inetutils
-
which
-
];
-
script = ''
-
export UUID=$(cat ${cfg.uuidFile})
-
exec ${pkgs.nur.repos.xddxdd.dn42-pingfinder}/bin/dn42-pingfinder
-
'';
-
serviceConfig = {
-
Type = "oneshot";
-
TimeoutSec = 900;
-
RuntimeDirectory = "dn42-pingfinder";
-
WorkingDirectory = "/run/dn42-pingfinder";
-
};
-
unitConfig = {
-
After = "network.target";
-
};
-
};
-
-
systemd.timers.dn42-pingfinder = {
-
wantedBy = [ "timers.target" ];
-
partOf = [ "dn42-pingfinder.service" ];
-
timerConfig = {
-
OnCalendar = "*:0/5";
-
Persistent = true;
-
Unit = "dn42-pingfinder.service";
-
};
-
};
-
};
-
}