2017-05-02 00:01:39 +00:00
|
|
|
{pkgs, config, lib, ...}:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.shibboleth-sp;
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
services.shibboleth-sp = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
2022-07-28 21:19:15 +00:00
|
|
|
description = lib.mdDoc "Whether to enable the shibboleth service";
|
2017-05-02 00:01:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
configFile = mkOption {
|
|
|
|
type = types.path;
|
2021-10-03 16:06:03 +00:00
|
|
|
example = literalExpression ''"''${pkgs.shibboleth-sp}/etc/shibboleth/shibboleth2.xml"'';
|
2022-07-28 21:19:15 +00:00
|
|
|
description = lib.mdDoc "Path to shibboleth config file";
|
2017-05-02 00:01:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fastcgi.enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
2022-07-28 21:19:15 +00:00
|
|
|
description = lib.mdDoc "Whether to include the shibauthorizer and shibresponder FastCGI processes";
|
2017-05-02 00:01:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fastcgi.shibAuthorizerPort = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 9100;
|
2022-07-28 21:19:15 +00:00
|
|
|
description = lib.mdDoc "Port for shibauthorizer FastCGI proccess to bind to";
|
2017-05-02 00:01:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fastcgi.shibResponderPort = mkOption {
|
|
|
|
type = types.int;
|
|
|
|
default = 9101;
|
2022-07-28 21:19:15 +00:00
|
|
|
description = lib.mdDoc "Port for shibauthorizer FastCGI proccess to bind to";
|
2017-05-02 00:01:39 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.services.shibboleth-sp = {
|
|
|
|
description = "Provides SSO and federation for web applications";
|
|
|
|
after = lib.optionals cfg.fastcgi.enable [ "shibresponder.service" "shibauthorizer.service" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${pkgs.shibboleth-sp}/bin/shibd -F -d ${pkgs.shibboleth-sp} -c ${cfg.configFile}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.shibresponder = mkIf cfg.fastcgi.enable {
|
|
|
|
description = "Provides SSO through Shibboleth via FastCGI";
|
|
|
|
after = [ "network.target" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
path = [ "${pkgs.spawn_fcgi}" ];
|
2017-05-02 23:55:11 +00:00
|
|
|
environment.SHIBSP_CONFIG = "${cfg.configFile}";
|
2017-05-02 00:01:39 +00:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${pkgs.spawn_fcgi}/bin/spawn-fcgi -n -p ${toString cfg.fastcgi.shibResponderPort} ${pkgs.shibboleth-sp}/lib/shibboleth/shibresponder";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.shibauthorizer = mkIf cfg.fastcgi.enable {
|
|
|
|
description = "Provides SSO through Shibboleth via FastCGI";
|
|
|
|
after = [ "network.target" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
path = [ "${pkgs.spawn_fcgi}" ];
|
2017-05-02 23:55:11 +00:00
|
|
|
environment.SHIBSP_CONFIG = "${cfg.configFile}";
|
2017-05-02 00:01:39 +00:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${pkgs.spawn_fcgi}/bin/spawn-fcgi -n -p ${toString cfg.fastcgi.shibAuthorizerPort} ${pkgs.shibboleth-sp}/lib/shibboleth/shibauthorizer";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2017-05-16 09:11:55 +00:00
|
|
|
|
|
|
|
meta.maintainers = with lib.maintainers; [ jammerful ];
|
2017-05-02 00:01:39 +00:00
|
|
|
}
|