summary refs log tree commit diff
path: root/nixos/modules/services/networking/hans.nix
diff options
context:
space:
mode:
authorgnidorah <gnidorah@users.noreply.github.com>2018-03-28 08:32:29 +0300
committergnidorah <gnidorah@users.noreply.github.com>2018-03-28 10:34:57 +0300
commit33c34aff2fb42268f45c5563f767266e27c58a9b (patch)
treefb009e45b2a4c445d0f3742914f40fd63149364c /nixos/modules/services/networking/hans.nix
parent276d10dae6b14e457c8206e9e292ce8341434520 (diff)
downloadnixpkgs-33c34aff2fb42268f45c5563f767266e27c58a9b.tar
nixpkgs-33c34aff2fb42268f45c5563f767266e27c58a9b.tar.gz
nixpkgs-33c34aff2fb42268f45c5563f767266e27c58a9b.tar.bz2
nixpkgs-33c34aff2fb42268f45c5563f767266e27c58a9b.tar.lz
nixpkgs-33c34aff2fb42268f45c5563f767266e27c58a9b.tar.xz
nixpkgs-33c34aff2fb42268f45c5563f767266e27c58a9b.tar.zst
nixpkgs-33c34aff2fb42268f45c5563f767266e27c58a9b.zip
hans, iodine: correct script
Diffstat (limited to 'nixos/modules/services/networking/hans.nix')
-rw-r--r--nixos/modules/services/networking/hans.nix20
1 files changed, 2 insertions, 18 deletions
diff --git a/nixos/modules/services/networking/hans.nix b/nixos/modules/services/networking/hans.nix
index 1b54a822aae..4579154d78f 100644
--- a/nixos/modules/services/networking/hans.nix
+++ b/nixos/modules/services/networking/hans.nix
@@ -115,18 +115,10 @@ in
         description = "hans client - ${name}";
         after = [ "network.target" ];
         wantedBy = [ "multi-user.target" ];
-        preStart = ''
-          cat > /run/hans/${name}-script << EOF
-            #!/bin/sh
-            ${pkgs.hans}/bin/hans -f -u ${hansUser} ${cfg.extraConfig} -c ${cfg.server} ${optionalString (cfg.passwordFile != "") "-p $(cat \"${cfg.passwordFile}\")"} 
-          EOF
-          chmod 700 /run/hans/${name}-script
-        '';
-        script = "/run/hans/${name}-script";
+        script = "${pkgs.hans}/bin/hans -f -u ${hansUser} ${cfg.extraConfig} -c ${cfg.server} ${optionalString (cfg.passwordFile != "") "-p $(cat \"${cfg.passwordFile}\")"}";
         serviceConfig = {
           RestartSec = "30s";
           Restart = "always";
-          RuntimeDirectory = [ "hans" ];
         };
       };
     in
@@ -139,15 +131,7 @@ in
         description = "hans, ip over icmp server daemon";
         after = [ "network.target" ];
         wantedBy = [ "multi-user.target" ];
-        preStart = ''
-          cat > /run/hans/script << EOF
-            #!/bin/sh
-            ${pkgs.hans}/bin/hans -f -u ${hansUser} ${cfg.server.extraConfig} -s ${cfg.server.ip} ${optionalString cfg.server.systemPings "-r"} ${optionalString (cfg.passwordFile != "") "-p $(cat \"${cfg.passwordFile}\")"}
-          EOF
-          chmod 700 /run/hans/script
-        '';
-        script = "/run/hans/script";
-        serviceConfig.RuntimeDirectory = [ "hans" ];
+        script = "${pkgs.hans}/bin/hans -f -u ${hansUser} ${cfg.server.extraConfig} -s ${cfg.server.ip} ${optionalString cfg.server.systemPings "-r"} ${optionalString (cfg.passwordFile != "") "-p $(cat \"${cfg.passwordFile}\")"}";
       };
     };