nixos: kerberos services for the server.
svn path=/nixos/trunk/; revision=22985
This commit is contained in:
parent
793767870a
commit
6436ed1de4
|
@ -110,6 +110,7 @@
|
||||||
./services/system/dbus.nix
|
./services/system/dbus.nix
|
||||||
./services/system/nscd.nix
|
./services/system/nscd.nix
|
||||||
./services/system/uptimed.nix
|
./services/system/uptimed.nix
|
||||||
|
./services/system/kerberos.nix
|
||||||
./services/ttys/gpm.nix
|
./services/ttys/gpm.nix
|
||||||
./services/ttys/mingetty.nix
|
./services/ttys/mingetty.nix
|
||||||
./services/web-servers/apache-httpd/default.nix
|
./services/web-servers/apache-httpd/default.nix
|
||||||
|
|
|
@ -26,6 +26,7 @@ let
|
||||||
{
|
{
|
||||||
protocol = ${srv.protocol}
|
protocol = ${srv.protocol}
|
||||||
${optionalString srv.unlisted "type = UNLISTED"}
|
${optionalString srv.unlisted "type = UNLISTED"}
|
||||||
|
${optionalString (srv.flags != "") "flags = ${srv.flags}"}
|
||||||
socket_type = ${if srv.protocol == "udp" then "dgram" else "stream"}
|
socket_type = ${if srv.protocol == "udp" then "dgram" else "stream"}
|
||||||
${if srv.port != 0 then "port = ${toString srv.port}" else ""}
|
${if srv.port != 0 then "port = ${toString srv.port}" else ""}
|
||||||
wait = ${if srv.protocol == "udp" then "yes" else "no"}
|
wait = ${if srv.protocol == "udp" then "yes" else "no"}
|
||||||
|
@ -98,6 +99,12 @@ in
|
||||||
description = "Command-line arguments for the server program.";
|
description = "Command-line arguments for the server program.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
flags = mkOption {
|
||||||
|
type = types.string;
|
||||||
|
default = "";
|
||||||
|
description = "";
|
||||||
|
};
|
||||||
|
|
||||||
unlisted = mkOption {
|
unlisted = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
{pkgs, config, ...}:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
inherit (pkgs.lib) mkOption mkIf singleton;
|
||||||
|
|
||||||
|
inherit (pkgs) heimdal;
|
||||||
|
|
||||||
|
stateDir = "/var/heimdal";
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
services.kerberos_server = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Enable the kerberos authentification server.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
|
config = mkIf config.services.kerberos_server.enable {
|
||||||
|
|
||||||
|
environment.systemPackages = [ heimdal ];
|
||||||
|
|
||||||
|
services.xinetd.enable = true;
|
||||||
|
services.xinetd.services = pkgs.lib.singleton
|
||||||
|
{ name = "kerberos-adm";
|
||||||
|
flags = "REUSE NAMEINARGS";
|
||||||
|
protocol = "tcp";
|
||||||
|
user = "root";
|
||||||
|
server = "${pkgs.tcpWrapper}/sbin/tcpd";
|
||||||
|
serverArgs = "${pkgs.heimdal}/sbin/kadmind";
|
||||||
|
};
|
||||||
|
|
||||||
|
jobs.kdc =
|
||||||
|
{ description = "Kerberos Domain Controller daemon";
|
||||||
|
|
||||||
|
startOn = "ip-up";
|
||||||
|
|
||||||
|
preStart =
|
||||||
|
''
|
||||||
|
mkdir -m 0755 -p ${stateDir}
|
||||||
|
'';
|
||||||
|
|
||||||
|
exec = "${heimdal}/sbin/kdc";
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
jobs.kpasswdd =
|
||||||
|
{ description = "Kerberos Domain Controller daemon";
|
||||||
|
|
||||||
|
startOn = "ip-up";
|
||||||
|
|
||||||
|
exec = "${heimdal}/sbin/kpasswdd";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue