Add given password for hosts/mermet/knot/sourcephile.fr/lebureau.conf to store.
[sourcephile-nix.git] / nixos / modules / services / networking / upnpc.nix
index 6c090257a8b53d5179d580cc95c3c243da49efb3..3ff2053ca6fa316bd1080dc93aaeb40c3144fe8f 100644 (file)
@@ -110,9 +110,10 @@ in
               '';
               ExecStop = "${pkgs.miniupnpc}/bin/upnpc -d ${toString r.externalPort} ${r.protocol}";
               Restart = "on-failure";
-              RestartSec = mkDefault r.maintainPeriod;
               DynamicUser = true;
               User = users."upnpc".name;
+            } // lib.optionalAttrs (r.maintainPeriod != null) {
+              RestartSec = mkDefault r.maintainPeriod;
             };
           }
           r.service
@@ -120,6 +121,8 @@ in
       )
       cfg.redirections);
 
+    environment.systemPackages = [ pkgs.miniupnpc ];
+
     # This enables to match on the uid in the firewall.
     users.users."upnpc" = {
       isSystemUser = true;