git.iko.soy/typeable/nixpkgs
on master help sign in
gitit service: add github authentication
dbd125bPaul Wilson
nixos/modules/services/misc/gitit.nix+45−2
@@ -99,7 +99,7 @@ let
99 };
99 };
100
100
101 authenticationMethod = mkOption {
101 authenticationMethod = mkOption {
102− type = types.enum [ "form" "http" "generic"];
102+ type = types.enum [ "form" "http" "generic" "github" ];
103 default = "form";
103 default = "form";
104 description = ''
104 description = ''
105 'form' means that users will be logged in and registered using forms
105 'form' means that users will be logged in and registered using forms
@@ -537,6 +537,42 @@ video/x-ms-wmx wmx
537 through xss-sanitize. Set to no only if you trust all of your users.
537 through xss-sanitize. Set to no only if you trust all of your users.
538 '';
538 '';
539 };
539 };
540+
541+ oauthClientId = mkOption {
542+ type = with types; nullOr str;
543+ default = null;
544+ description = "OAuth client ID";
545+ };
546+
547+ oauthClientSecret = mkOption {
548+ type = with types; nullOr str;
549+ default = null;
550+ description = "OAuth client secret";
551+ };
552+
553+ oauthCallback = mkOption {
554+ type = with types; nullOr str;
555+ default = null;
556+ description = "OAuth callback URL";
557+ };
558+
559+ oauthAuthorizeEndpoint = mkOption {
560+ type = with types; nullOr str;
561+ default = null;
562+ description = "OAuth authorize endpoint";
563+ };
564+
565+ oauthAccessTokenEndpoint = mkOption {
566+ type = with types; nullOr str;
567+ default = null;
568+ description = "OAuth access token endpoint";
569+ };
570+
571+ githubOrg = mkOption {
572+ type = with types; nullOr str;
573+ default = null;
574+ description = "Github organization";
575+ };
540 };
576 };
541
577
542 configFile = pkgs.writeText "gitit.conf" ''
578 configFile = pkgs.writeText "gitit.conf" ''
@@ -587,6 +623,14 @@ video/x-ms-wmx wmx
587 pdf-export: ${toYesNo cfg.pdfExport}
623 pdf-export: ${toYesNo cfg.pdfExport}
588 pandoc-user-data: ${toString cfg.pandocUserData}
624 pandoc-user-data: ${toString cfg.pandocUserData}
589 xss-sanitize: ${toYesNo cfg.xssSanitize}
625 xss-sanitize: ${toYesNo cfg.xssSanitize}
626+
627+ [Github]
628+ oauthclientid: ${cfg.oauthClientId}
629+ oauthclientsecret: ${cfg.oauthClientSecret}
630+ oauthcallback: ${cfg.oauthCallback}
631+ oauthauthorizeendpoint: ${cfg.oauthAuthorizeEndpoint}
632+ oauthaccesstokenendpoint: ${cfg.oauthAccessTokenEndpoint}
633+ github-org: ${cfg.githubOrg}
590 '';
634 '';
591
635
592in
636in
@@ -681,4 +725,3 @@ NAMED
681 };
725 };
682 };
726 };
683}
727}
684−