1 { config, lib, pkgs, ... }:
6 cfg = config.services.nginx.sso;
7 pkg = getBin cfg.package;
8 configYml = pkgs.writeText "nginx-sso.yml" (builtins.toJSON cfg.configuration);
10 options.services.nginx.sso = {
11 enable = mkEnableOption "nginx-sso service";
13 package = mkPackageOption pkgs "nginx-sso" { };
15 configuration = mkOption {
16 type = types.attrsOf types.unspecified;
18 example = literalExpression ''
20 listen = { addr = "127.0.0.1"; port = 8080; };
22 providers.token.tokens = {
29 rules = [ { field = "x-application"; equals = "MyApp"; } ];
37 nginx-sso configuration
38 ([documentation](https://github.com/Luzifer/nginx-sso/wiki/Main-Configuration))
39 as a Nix attribute set.
44 config = mkIf cfg.enable {
45 systemd.services.nginx-sso = {
46 description = "Nginx SSO Backend";
47 after = [ "network.target" ];
48 wantedBy = [ "multi-user.target" ];
51 ${pkg}/bin/nginx-sso \
52 --config ${configYml} \
53 --frontend-dir ${pkg}/share/frontend