mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-21 04:28:40 +03:00
Merge pull request #153901 from flokli/sniproxy-logdir
nixos/sniproxy: remove unused logDir option
This commit is contained in:
commit
982de405d7
@ -14,6 +14,8 @@ let
|
|||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
imports = [ (mkRemovedOptionModule [ "services" "sniproxy" "logDir" ] "Now done by LogsDirectory=. Set to a custom path if you log to a different folder in your config.") ];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
services.sniproxy = {
|
services.sniproxy = {
|
||||||
enable = mkEnableOption "sniproxy server";
|
enable = mkEnableOption "sniproxy server";
|
||||||
@ -50,13 +52,6 @@ in
|
|||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
logDir = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "/var/log/sniproxy/";
|
|
||||||
description = "Location of the log directory for sniproxy.";
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -66,18 +61,12 @@ in
|
|||||||
description = "sniproxy server";
|
description = "sniproxy server";
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
preStart = ''
|
|
||||||
test -d ${cfg.logDir} || {
|
|
||||||
echo "Creating initial log directory for sniproxy in ${cfg.logDir}"
|
|
||||||
mkdir -p ${cfg.logDir}
|
|
||||||
chmod 640 ${cfg.logDir}
|
|
||||||
}
|
|
||||||
chown -R ${cfg.user}:${cfg.group} ${cfg.logDir}
|
|
||||||
'';
|
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "forking";
|
Type = "forking";
|
||||||
ExecStart = "${pkgs.sniproxy}/bin/sniproxy -c ${configFile}";
|
ExecStart = "${pkgs.sniproxy}/bin/sniproxy -c ${configFile}";
|
||||||
|
LogsDirectory = "sniproxy";
|
||||||
|
LogsDirectoryMode = "0640";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user