From 686f62372d9088ffe5a8e0f06bfbb2124061767e Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Mon, 25 Aug 2025 10:05:30 +0200 Subject: [PATCH] argocd: Build the web-ui to make it usable (fixes #207618) --- pkgs/by-name/ar/argocd/package.nix | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/pkgs/by-name/ar/argocd/package.nix b/pkgs/by-name/ar/argocd/package.nix index d010594e0035..597778941003 100644 --- a/pkgs/by-name/ar/argocd/package.nix +++ b/pkgs/by-name/ar/argocd/package.nix @@ -5,6 +5,10 @@ installShellFiles, nix-update-script, stdenv, + fetchYarnDeps, + yarnConfigHook, + yarnBuildHook, + nodejs, }: buildGoModule rec { @@ -18,6 +22,28 @@ buildGoModule rec { hash = "sha256-zg6zd10hpGUOukrwMK0qJXBL8nVgPSZJ6+jh+/mbOL0="; }; + ui = stdenv.mkDerivation { + pname = "${pname}-ui"; + inherit version; + src = src + "/ui"; + + offlineCache = fetchYarnDeps { + yarnLock = "${src}/ui/yarn.lock"; + hash = "sha256-ekhSPWzIgFhwSw0bIlBqu8LTYk3vuJ9VM8eHc3mnHGM="; + }; + + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + nodejs + ]; + + postInstall = '' + mkdir -p $out + cp -r dist $out/dist + ''; + }; + proxyVendor = true; # darwin/linux hash mismatch vendorHash = "sha256-tYHA1WlziKWOvv3uF3tTSrvqDoHBVRhUnKZXOxT1rMk="; @@ -41,6 +67,11 @@ buildGoModule rec { nativeBuildInputs = [ installShellFiles ]; + preBuild = '' + cp -r ${ui}/dist ./ui + stat ./ui/dist/app/index.html # Sanity check + ''; + # set ldflag for kubectlVersion since it is needed for argo # Per https://github.com/search?q=repo%3Aargoproj%2Fargo-cd+%22KUBECTL_VERSION%3D%22+path%3AMakefile&type=code prePatch = ''