{ lib, buildNpmPackage, nodejs_22, fetchFromGitHub, }: buildNpmPackage rec { pname = "airdrome"; version = "4.3"; src = fetchFromGitHub { owner = "JPGuillemin"; repo = "Airdrome"; rev = version; hash = "sha256-UGJMbrrX6pBjQJFiQtb1QvECvgVQMk8gDuJJhbFW9HQ="; }; nodejs = nodejs_22; npmDepsHash = "sha256-zgKmXSOdCaMbg520IpT93n3e/6KW+wMUQ94wGfyKXz0="; postPatch = '' # Remove vite-plugin-checker — vue-tsc fails in sandbox because # tsconfig lacks the bootstrap-vue-3 alias. Not needed for prod builds. sed -i '/import checker/d' vite.config.mjs sed -i '/checker({/,/}),/d' vite.config.mjs # Add resolve alias: bootstrap-vue-3 → bootstrap-vue-next # (upstream imports use the old name but only bootstrap-vue-next is installed) sed -i "s|'@': fileURLToPath(new URL('./src', import.meta.url))|'@': fileURLToPath(new URL('./src', import.meta.url)),\n 'bootstrap-vue-3': 'bootstrap-vue-next'|" vite.config.mjs # Fix index.html — add missing \n |' index.html # Extend Config interface in auth/service.ts with username + password sed -i 's/serverUrl: string/serverUrl: string\n username: string\n password: string/' src/auth/service.ts sed -i "s|serverUrl: env?.SERVER_URL.*|serverUrl: env?.SERVER_URL \|\| ${"''"},\n username: env?.USERNAME \|\| ${"''"},\n password: env?.PASSWORD \|\| ${"''"},|" src/auth/service.ts # Patch Login.vue — auto-login with hardcoded credentials before autoLogin() sed -i '/onMounted(async() => {/a\ if (config.serverUrl \&\& config.username \&\& config.password) {\ try {\ await auth.loginWithPassword(config.serverUrl, config.username, config.password)\ store.setLoginSuccess(auth.username, auth.server)\ await router.replace(props.returnTo)\ return\ } catch {}\ }' src/auth/Login.vue ''; installPhase = '' runHook preInstall mkdir -p "$out" cp -r dist/. "$out/" echo 'window.env = {};' > "$out/env.js" runHook postInstall ''; meta = { description = "Modern web UI for Subsonic-compatible music servers"; homepage = "https://github.com/JPGuillemin/Airdrome"; license = lib.licenses.mit; platforms = lib.platforms.all; }; }