From 960bc776bb05d51e243269540929dbea06277653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Wed, 9 Apr 2025 01:12:49 +0200 Subject: [PATCH] Make gopkgs a split package --- components/gopkgs.nix | 11 +++++++++++ module.nix | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/components/gopkgs.nix b/components/gopkgs.nix index 7e520db..a97f97d 100644 --- a/components/gopkgs.nix +++ b/components/gopkgs.nix @@ -36,6 +36,12 @@ buildGo124Module { )) ); }; + outputs = [ + "out" + "ldap" + "proxy" + "radius" + ]; subPackages = [ "cmd/ldap" "cmd/server" @@ -48,5 +54,10 @@ buildGo124Module { postInstall = '' wrapProgram $out/bin/server --prefix PATH : ${authentikComponents.pythonEnv}/bin wrapProgram $out/bin/server --prefix PYTHONPATH : ${authentikComponents.staticWorkdirDeps} + + mkdir -p $ldap/bin $proxy/bin $radius/bin + mv $out/bin/ldap $ldap/bin/ + mv $out/bin/proxy $proxy/bin/ + mv $out/bin/radius $radius/bin/ ''; } diff --git a/module.nix b/module.nix index 43294aa..f76aa2d 100644 --- a/module.nix +++ b/module.nix @@ -458,7 +458,7 @@ in UMask = "0027"; WorkingDirectory = "%t/authentik-ldap"; DynamicUser = true; - ExecStart = "${config.services.authentik.authentikComponents.gopkgs}/bin/ldap"; + ExecStart = "${config.services.authentik.authentikComponents.gopkgs.ldap}/bin/ldap"; EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ]; Restart = "on-failure"; }; @@ -489,7 +489,7 @@ in UMask = "0027"; WorkingDirectory = "%t/authentik-proxy"; DynamicUser = true; - ExecStart = "${config.services.authentik.authentikComponents.gopkgs}/bin/proxy"; + ExecStart = "${config.services.authentik.authentikComponents.gopkgs.proxy}/bin/proxy"; EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ]; Restart = "on-failure"; }; @@ -516,7 +516,7 @@ in UMask = "0027"; WorkingDirectory = "%t/authentik-radius"; DynamicUser = true; - ExecStart = "${config.services.authentik.authentikComponents.gopkgs}/bin/radius"; + ExecStart = "${config.services.authentik.authentikComponents.gopkgs.radius}/bin/radius"; EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ]; Restart = "on-failure"; };