git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #25422 from jammerful/shibservice

Add Shibboleth Service Provider Module

commit436ece25b62353e5aa426242c2c796e94582071e authorDaniel Peebles <copumpkin@users.noreply.github.com> dateTue 2 May 2017, 11:47 (10 years ago) parentec7f6209f18af5
2 files changed+72
nixos/modules/module-list.nix+1 nixos/modules/services/security/shibboleth-sp.nix+71
nixos/modules/module-list.nix+1
@@ -534,6 +534,7 @@
534534 ./services/security/munge.nix
535535 ./services/security/oauth2_proxy.nix
536536 ./services/security/physlock.nix
537+ ./services/security/shibboleth-sp.nix
537538 ./services/security/sshguard.nix
538539 ./services/security/tor.nix
539540 ./services/security/torify.nix
nixos/modules/services/security/shibboleth-sp.nixnew file+71
@@ -0,0 +1,71 @@
1+{pkgs, config, lib, ...}:
2+
3+with lib;
4+let
5+ cfg = config.services.shibboleth-sp;
6+in {
7+ options = {
8+ services.shibboleth-sp = {
9+ enable = mkOption {
10+ type = types.bool;
11+ default = false;
12+ description = "Whether to enable the shibboleth service";
13+ };
14+
15+ configFile = mkOption {
16+ type = types.path;
17+ example = "${pkgs.shibboleth-sp}/etc/shibboleth/shibboleth2.xml";
18+ description = "Path to shibboleth config file";
19+ };
20+
21+ fastcgi.enable = mkOption {
22+ type = types.bool;
23+ default = false;
24+ description = "Whether to include the shibauthorizer and shibresponder FastCGI processes";
25+ };
26+
27+ fastcgi.shibAuthorizerPort = mkOption {
28+ type = types.int;
29+ default = 9100;
30+ description = "Port for shibauthorizer FastCGI proccess to bind to";
31+ };
32+
33+ fastcgi.shibResponderPort = mkOption {
34+ type = types.int;
35+ default = 9101;
36+ description = "Port for shibauthorizer FastCGI proccess to bind to";
37+ };
38+ };
39+ };
40+
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" ];
46+ serviceConfig = {
47+ ExecStart = "${pkgs.shibboleth-sp}/bin/shibd -F -d ${pkgs.shibboleth-sp} -c ${cfg.configFile}";
48+ };
49+ };
50+
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+ serviceConfig = {
57+ ExecStart = "${pkgs.spawn_fcgi}/bin/spawn-fcgi -n -p ${toString cfg.fastcgi.shibResponderPort} ${pkgs.shibboleth-sp}/lib/shibboleth/shibresponder";
58+ };
59+ };
60+
61+ systemd.services.shibauthorizer = mkIf cfg.fastcgi.enable {
62+ description = "Provides SSO through Shibboleth via FastCGI";
63+ after = [ "network.target" ];
64+ wantedBy = [ "multi-user.target" ];
65+ path = [ "${pkgs.spawn_fcgi}" ];
66+ serviceConfig = {
67+ ExecStart = "${pkgs.spawn_fcgi}/bin/spawn-fcgi -n -p ${toString cfg.fastcgi.shibAuthorizerPort} ${pkgs.shibboleth-sp}/lib/shibboleth/shibauthorizer";
68+ };
69+ };
70+ };
71+}