diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-06-16 06:56:35 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-06-16 06:56:35 +0000 |
commit | 99fcaeccb89621dd492203ce1f2d551c06f228ed (patch) | |
tree | 41cb730ae07383004789779b0f6e11cb3f4642a3 /nixpkgs/pkgs/servers/authelia/default.nix | |
parent | 59c5f5ac8682acc13bb22bc29c7cf02f7d75f01f (diff) | |
parent | 75a5ebf473cd60148ba9aec0d219f72e5cf52519 (diff) | |
download | nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.gz nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.bz2 nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.lz nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.xz nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.zst nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.zip |
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts: nixpkgs/nixos/modules/config/console.nix nixpkgs/nixos/modules/services/mail/mailman.nix nixpkgs/nixos/modules/services/mail/public-inbox.nix nixpkgs/nixos/modules/services/mail/rss2email.nix nixpkgs/nixos/modules/services/networking/ssh/sshd.nix nixpkgs/pkgs/applications/networking/instant-messengers/dino/default.nix nixpkgs/pkgs/applications/networking/irc/weechat/default.nix nixpkgs/pkgs/applications/window-managers/sway/default.nix nixpkgs/pkgs/build-support/go/module.nix nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix nixpkgs/pkgs/development/interpreters/python/default.nix nixpkgs/pkgs/development/node-packages/overrides.nix nixpkgs/pkgs/development/tools/b4/default.nix nixpkgs/pkgs/servers/dict/dictd-db.nix nixpkgs/pkgs/servers/mail/public-inbox/default.nix nixpkgs/pkgs/tools/security/pinentry/default.nix nixpkgs/pkgs/tools/text/unoconv/default.nix nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/servers/authelia/default.nix')
-rw-r--r-- | nixpkgs/pkgs/servers/authelia/default.nix | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/authelia/default.nix b/nixpkgs/pkgs/servers/authelia/default.nix new file mode 100644 index 000000000000..4a2ed9bd5729 --- /dev/null +++ b/nixpkgs/pkgs/servers/authelia/default.nix @@ -0,0 +1,77 @@ +{ lib, fetchFromGitHub, buildGoModule, installShellFiles, callPackage, nixosTests }: + +let + inherit (import ./sources.nix { inherit fetchFromGitHub; }) pname version src vendorHash; + web = callPackage ./web.nix { }; +in +buildGoModule rec { + inherit pname version src vendorHash; + + nativeBuildInputs = [ installShellFiles ]; + + postPatch = '' + cp -r ${web}/share/authelia-web/* internal/server/public_html + ''; + + subPackages = [ "cmd/authelia" ]; + + ldflags = + let + p = "github.com/authelia/authelia/v${lib.versions.major version}/internal/utils"; + in + [ + "-s" + "-w" + "-X ${p}.BuildTag=v${version}" + "-X '${p}.BuildState=tagged clean'" + "-X ${p}.BuildBranch=v${version}" + "-X ${p}.BuildExtra=nixpkgs" + ]; + + # several tests with networking and several that want chromium + doCheck = false; + + postInstall = '' + mkdir -p $out/etc/authelia + cp config.template.yml $out/etc/authelia + + installShellCompletion --cmd authelia \ + --bash <($out/bin/authelia completion bash) \ + --fish <($out/bin/authelia completion fish) \ + --zsh <($out/bin/authelia completion zsh) + ''; + + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + + $out/bin/authelia --help + $out/bin/authelia --version | grep "v${version}" + $out/bin/authelia build-info | grep 'v${version}\|nixpkgs' + + runHook postInstallCheck + ''; + + passthru = { + # if overriding replace the postPatch to put your web UI output in internal/server/public_html + inherit web; + updateScript = ./update.sh; + tests = { inherit (nixosTests) authelia; }; + }; + + meta = with lib; { + homepage = "https://www.authelia.com/"; + changelog = "https://github.com/authelia/authelia/releases/tag/v${version}"; + description = "A Single Sign-On Multi-Factor portal for web apps"; + longDescription = '' + Authelia is an open-source authentication and authorization server + providing two-factor authentication and single sign-on (SSO) for your + applications via a web portal. It acts as a companion for reverse proxies + like nginx, Traefik, caddy or HAProxy to let them know whether requests + should either be allowed or redirected to Authelia's portal for + authentication. + ''; + license = licenses.asl20; + maintainers = with maintainers; [ jk raitobezarius dit7ya ]; + }; +} |