1 {pkgs, config, lib, ...}:
5 cfg = config.services.shibboleth-sp;
8 services.shibboleth-sp = {
12 description = lib.mdDoc "Whether to enable the shibboleth service";
15 configFile = mkOption {
17 example = literalExpression ''"''${pkgs.shibboleth-sp}/etc/shibboleth/shibboleth2.xml"'';
18 description = lib.mdDoc "Path to shibboleth config file";
21 fastcgi.enable = mkOption {
24 description = lib.mdDoc "Whether to include the shibauthorizer and shibresponder FastCGI processes";
27 fastcgi.shibAuthorizerPort = mkOption {
30 description = lib.mdDoc "Port for shibauthorizer FastCGI proccess to bind to";
33 fastcgi.shibResponderPort = mkOption {
36 description = lib.mdDoc "Port for shibauthorizer FastCGI proccess to bind to";
41 config = mkIf cfg.enable {
42 systemd.services.shibboleth-sp = {
43 description = "Provides SSO and federation for web applications";
44 after = lib.optionals cfg.fastcgi.enable [ "shibresponder.service" "shibauthorizer.service" ];
45 wantedBy = [ "multi-user.target" ];
47 ExecStart = "${pkgs.shibboleth-sp}/bin/shibd -F -d ${pkgs.shibboleth-sp} -c ${cfg.configFile}";
51 systemd.services.shibresponder = mkIf cfg.fastcgi.enable {
52 description = "Provides SSO through Shibboleth via FastCGI";
53 after = [ "network.target" ];
54 wantedBy = [ "multi-user.target" ];
55 path = [ "${pkgs.spawn_fcgi}" ];
56 environment.SHIBSP_CONFIG = "${cfg.configFile}";
58 ExecStart = "${pkgs.spawn_fcgi}/bin/spawn-fcgi -n -p ${toString cfg.fastcgi.shibResponderPort} ${pkgs.shibboleth-sp}/lib/shibboleth/shibresponder";
62 systemd.services.shibauthorizer = mkIf cfg.fastcgi.enable {
63 description = "Provides SSO through Shibboleth via FastCGI";
64 after = [ "network.target" ];
65 wantedBy = [ "multi-user.target" ];
66 path = [ "${pkgs.spawn_fcgi}" ];
67 environment.SHIBSP_CONFIG = "${cfg.configFile}";
69 ExecStart = "${pkgs.spawn_fcgi}/bin/spawn-fcgi -n -p ${toString cfg.fastcgi.shibAuthorizerPort} ${pkgs.shibboleth-sp}/lib/shibboleth/shibauthorizer";
74 meta.maintainers = with lib.maintainers; [ jammerful ];