summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2022-01-07 22:32:02 +0100
committerFlorian Klink <flokli@flokli.de>2022-01-07 22:40:12 +0100
commit6a75955c21c4f93dc0a24fc12729ab55039370c5 (patch)
tree8423abeafd962b7b5bea4184b38ea96a5b562585
parent801d832872a11a867b297d54cafd5ba34c5e41ae (diff)
downloadnixpkgs-6a75955c21c4f93dc0a24fc12729ab55039370c5.tar
nixpkgs-6a75955c21c4f93dc0a24fc12729ab55039370c5.tar.gz
nixpkgs-6a75955c21c4f93dc0a24fc12729ab55039370c5.tar.bz2
nixpkgs-6a75955c21c4f93dc0a24fc12729ab55039370c5.tar.lz
nixpkgs-6a75955c21c4f93dc0a24fc12729ab55039370c5.tar.xz
nixpkgs-6a75955c21c4f93dc0a24fc12729ab55039370c5.tar.zst
nixpkgs-6a75955c21c4f93dc0a24fc12729ab55039370c5.zip
nixos/sniproxy: remove unused logDir option
This never configured where SNI should log to, as it's up to the user to
provide the full sniproxy config (which can be configured to log to a
file).

This option only produced a ExecStartPre script that created the folder.

Let's use LogsDirectory to create it. In case users want to use another
directory for logs, they can override LogsDirectory or set their own
ExecStartPre script.
-rw-r--r--nixos/modules/services/networking/sniproxy.nix19
1 files changed, 4 insertions, 15 deletions
diff --git a/nixos/modules/services/networking/sniproxy.nix b/nixos/modules/services/networking/sniproxy.nix
index 28c201f0565..adca5398e4a 100644
--- a/nixos/modules/services/networking/sniproxy.nix
+++ b/nixos/modules/services/networking/sniproxy.nix
@@ -14,6 +14,8 @@ let
 
 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 = {
     services.sniproxy = {
       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";
       after = [ "network.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 = {
         Type = "forking";
         ExecStart = "${pkgs.sniproxy}/bin/sniproxy -c ${configFile}";
+        LogsDirectory = "sniproxy";
+        LogsDirectoryMode = "0640";
         Restart = "always";
       };
     };