1 { lib, nodejs, pnpm, fetchFromGitHub, buildGoModule, installShellFiles, callPackage, nixosTests }:
4 inherit (import ./sources.nix { inherit fetchFromGitHub; }) pname version src vendorHash;
5 web = callPackage ./web.nix { inherit nodejs pnpm fetchFromGitHub; };
8 inherit pname version src vendorHash;
10 nativeBuildInputs = [ installShellFiles ];
12 ## FIXME: add swagger-ui https://github.com/authelia/authelia/blob/master/cmd/authelia-scripts/cmd/build.go#L148
14 cp -r api internal/server/public_html
15 cp -r ${web}/share/authelia-web/* internal/server/public_html
18 subPackages = [ "cmd/authelia" ];
22 p = "github.com/authelia/authelia/v${lib.versions.major version}/internal/utils";
27 "-X ${p}.BuildTag=v${version}"
28 "-X '${p}.BuildState=tagged clean'"
29 "-X ${p}.BuildBranch=v${version}"
30 "-X ${p}.BuildExtra=nixpkgs"
33 # several tests with networking and several that want chromium
37 mkdir -p $out/etc/authelia
38 cp config.template.yml $out/etc/authelia
40 installShellCompletion --cmd authelia \
41 --bash <($out/bin/authelia completion bash) \
42 --fish <($out/bin/authelia completion fish) \
43 --zsh <($out/bin/authelia completion zsh)
46 doInstallCheck = true;
47 installCheckPhase = ''
48 runHook preInstallCheck
50 $out/bin/authelia --help
51 $out/bin/authelia --version | grep "v${version}"
52 $out/bin/authelia build-info | grep 'v${version}\|nixpkgs'
54 runHook postInstallCheck
58 # if overriding replace the postPatch to put your web UI output in internal/server/public_html
60 updateScript = ./update.sh;
61 tests = { inherit (nixosTests) authelia; };
65 homepage = "https://www.authelia.com/";
66 changelog = "https://github.com/authelia/authelia/releases/tag/v${version}";
67 description = "Single Sign-On Multi-Factor portal for web apps";
69 Authelia is an open-source authentication and authorization server
70 providing two-factor authentication and single sign-on (SSO) for your
71 applications via a web portal. It acts as a companion for reverse proxies
72 like nginx, Traefik, caddy or HAProxy to let them know whether requests
73 should either be allowed or redirected to Authelia's portal for
76 license = licenses.asl20;
77 maintainers = with maintainers; [ jk dit7ya nicomem ];
78 mainProgram = "authelia";