diff --git a/nixos/modules/services/networking/freeradius.nix b/nixos/modules/services/networking/freeradius.nix index 39a137aa541c..19e5b0af1c9d 100644 --- a/nixos/modules/services/networking/freeradius.nix +++ b/nixos/modules/services/networking/freeradius.nix @@ -10,14 +10,14 @@ let after = ["network.target"]; wants = ["network.target"]; preStart = '' - ${pkgs.freeradius}/bin/radiusd -C -d ${cfg.configDir} -l stdout + ${cfg.package}/bin/radiusd -C -d ${cfg.configDir} -l stdout ''; serviceConfig = { - ExecStart = "${pkgs.freeradius}/bin/radiusd -f -d ${cfg.configDir} -l stdout" + + ExecStart = "${cfg.package}/bin/radiusd -f -d ${cfg.configDir} -l stdout" + lib.optionalString cfg.debug " -xx"; ExecReload = [ - "${pkgs.freeradius}/bin/radiusd -C -d ${cfg.configDir} -l stdout" + "${cfg.package}/bin/radiusd -C -d ${cfg.configDir} -l stdout" "${pkgs.coreutils}/bin/kill -HUP $MAINPID" ]; User = "radius"; @@ -32,6 +32,8 @@ let freeradiusConfig = { enable = lib.mkEnableOption "the freeradius server"; + package = lib.mkPackageOption pkgs "freeradius" { }; + configDir = lib.mkOption { type = lib.types.path; default = "/etc/raddb"; @@ -72,7 +74,9 @@ in /*uid = config.ids.uids.radius;*/ description = "Radius daemon user"; isSystemUser = true; + groups = "radius"; }; + groups.radius = {}; }; systemd.services.freeradius = freeradiusService cfg; diff --git a/pkgs/servers/freeradius/default.nix b/pkgs/servers/freeradius/default.nix index 5be808d6b483..c84640869021 100644 --- a/pkgs/servers/freeradius/default.nix +++ b/pkgs/servers/freeradius/default.nix @@ -12,6 +12,7 @@ , withLdap ? true, openldap , withMemcached ? false, libmemcached , withMysql ? false, libmysqlclient +, withPostgresql ? false, postgresql , withPcap ? true, libpcap , withRedis ? false, hiredis , withRest ? false, curl @@ -41,6 +42,7 @@ stdenv.mkDerivation rec { ++ lib.optional withLdap openldap ++ lib.optional withMemcached libmemcached ++ lib.optional withMysql libmysqlclient + ++ lib.optional withPostgresql postgresql ++ lib.optional withPcap libpcap ++ lib.optional withRedis hiredis ++ lib.optional withRest curl