Merge pull request #224833 from flokli/smokeping-config

nixos/smokeping: use /etc/smokeping.conf
This commit is contained in:
Florian Klink 2023-04-05 21:54:57 +02:00 committed by GitHub
commit ea7dd83b0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,7 @@ let
configPath = pkgs.writeText "smokeping.conf" configFile;
cgiHome = pkgs.writeScript "smokeping.fcgi" ''
#!${pkgs.bash}/bin/bash
${cfg.package}/bin/smokeping_cgi ${configPath}
${cfg.package}/bin/smokeping_cgi /etc/smokeping.conf
'';
in
@ -307,6 +307,7 @@ in
source = "${pkgs.fping}/bin/fping";
};
};
environment.etc."smokeping.conf".source = configPath;
environment.systemPackages = [ pkgs.fping ];
users.users.${cfg.user} = {
isNormalUser = false;
@ -327,13 +328,14 @@ in
# Thus, we need to make `smokepingHome` (which is given to `thttpd -d` below) `755`.
homeMode = "755";
};
users.groups.${cfg.user} = {};
users.groups.${cfg.user} = { };
systemd.services.smokeping = {
requiredBy = [ "multi-user.target"];
reloadTriggers = [ configPath ];
requiredBy = [ "multi-user.target" ];
serviceConfig = {
User = cfg.user;
Restart = "on-failure";
ExecStart = "${cfg.package}/bin/smokeping --config=${configPath} --nodaemon";
ExecStart = "${cfg.package}/bin/smokeping --config=/etc/smokeping.conf --nodaemon";
};
preStart = ''
mkdir -m 0755 -p ${smokepingHome}/cache ${smokepingHome}/data