about summary refs log tree commit diff
path: root/nixos/modules/services/networking/freeradius.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2020-03-16 14:34:03 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2020-03-16 14:34:03 -0400
commit67b0ddf3f30d975bd41bc2ac1cc871436ed1af0e (patch)
treeeddc87a600bfd5cf9f6f6ff15f8e735664eae1e1 /nixos/modules/services/networking/freeradius.nix
parente9c2957c1465838c27c7a67e56a6ade95033eefd (diff)
parentb8cff61c330400e39dbac22b8993fe58fb35ec13 (diff)
downloadnixlib-67b0ddf3f30d975bd41bc2ac1cc871436ed1af0e.tar
nixlib-67b0ddf3f30d975bd41bc2ac1cc871436ed1af0e.tar.gz
nixlib-67b0ddf3f30d975bd41bc2ac1cc871436ed1af0e.tar.bz2
nixlib-67b0ddf3f30d975bd41bc2ac1cc871436ed1af0e.tar.lz
nixlib-67b0ddf3f30d975bd41bc2ac1cc871436ed1af0e.tar.xz
nixlib-67b0ddf3f30d975bd41bc2ac1cc871436ed1af0e.tar.zst
nixlib-67b0ddf3f30d975bd41bc2ac1cc871436ed1af0e.zip
Merge remote-tracking branch 'origin/staging' into mb-cross-fixes-march-2020
Diffstat (limited to 'nixos/modules/services/networking/freeradius.nix')
-rw-r--r--nixos/modules/services/networking/freeradius.nix18
1 files changed, 15 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/freeradius.nix b/nixos/modules/services/networking/freeradius.nix
index e192b70c129c..f3fdd576b65c 100644
--- a/nixos/modules/services/networking/freeradius.nix
+++ b/nixos/modules/services/networking/freeradius.nix
@@ -10,14 +10,15 @@ let
   {
     description = "FreeRadius server";
     wantedBy = ["multi-user.target"];
-    after = ["network-online.target"];
-    wants = ["network-online.target"];
+    after = ["network.target"];
+    wants = ["network.target"];
     preStart = ''
       ${pkgs.freeradius}/bin/radiusd -C -d ${cfg.configDir} -l stdout
     '';
 
     serviceConfig = {
-        ExecStart = "${pkgs.freeradius}/bin/radiusd -f -d ${cfg.configDir} -l stdout -xx";
+        ExecStart = "${pkgs.freeradius}/bin/radiusd -f -d ${cfg.configDir} -l stdout" +
+                    optionalString cfg.debug " -xx";
         ExecReload = [
           "${pkgs.freeradius}/bin/radiusd -C -d ${cfg.configDir} -l stdout"
           "${pkgs.coreutils}/bin/kill -HUP $MAINPID"
@@ -41,6 +42,16 @@ let
       '';
     };
 
+    debug = mkOption {
+      type = types.bool;
+      default = false;
+      description = ''
+        Whether to enable debug logging for freeradius (-xx
+        option). This should not be left on, since it includes
+        sensitive data such as passwords in the logs.
+      '';
+    };
+
   };
 
 in
@@ -66,6 +77,7 @@ in
     };
 
     systemd.services.freeradius = freeradiusService cfg;
+    warnings = optional cfg.debug "Freeradius debug logging is enabled. This will log passwords in plaintext to the journal!";
 
   };