1 { lib, fetchFromGitHub, buildGoModule, installShellFiles, callPackage, nixosTests }:
4 inherit (import ./sources.nix { inherit fetchFromGitHub; }) pname version src vendorHash;
5 web = callPackage ./web.nix { };
8 inherit pname version src vendorHash;
10 nativeBuildInputs = [ installShellFiles ];
13 cp -r ${web}/share/authelia-web/* internal/server/public_html
16 subPackages = [ "cmd/authelia" ];
20 p = "github.com/authelia/authelia/v${lib.versions.major version}/internal/utils";
25 "-X ${p}.BuildTag=v${version}"
26 "-X '${p}.BuildState=tagged clean'"
27 "-X ${p}.BuildBranch=v${version}"
28 "-X ${p}.BuildExtra=nixpkgs"
31 # several tests with networking and several that want chromium
35 mkdir -p $out/etc/authelia
36 cp config.template.yml $out/etc/authelia
38 installShellCompletion --cmd authelia \
39 --bash <($out/bin/authelia completion bash) \
40 --fish <($out/bin/authelia completion fish) \
41 --zsh <($out/bin/authelia completion zsh)
44 doInstallCheck = true;
45 installCheckPhase = ''
46 runHook preInstallCheck
48 $out/bin/authelia --help
49 $out/bin/authelia --version | grep "v${version}"
50 $out/bin/authelia build-info | grep 'v${version}\|nixpkgs'
52 runHook postInstallCheck
56 # if overriding replace the postPatch to put your web UI output in internal/server/public_html
58 updateScript = ./update.sh;
59 tests = { inherit (nixosTests) authelia; };
63 homepage = "https://www.authelia.com/";
64 changelog = "https://github.com/authelia/authelia/releases/tag/v${version}";
65 description = "A Single Sign-On Multi-Factor portal for web apps";
67 Authelia is an open-source authentication and authorization server
68 providing two-factor authentication and single sign-on (SSO) for your
69 applications via a web portal. It acts as a companion for reverse proxies
70 like nginx, Traefik, caddy or HAProxy to let them know whether requests
71 should either be allowed or redirected to Authelia's portal for
74 license = licenses.asl20;
75 maintainers = with maintainers; [ jk dit7ya ];
76 mainProgram = "authelia";