diff --git a/packages/hydrooj/src/loader.ts b/packages/hydrooj/src/loader.ts index d4482a2bc..74d8e407d 100644 --- a/packages/hydrooj/src/loader.ts +++ b/packages/hydrooj/src/loader.ts @@ -31,10 +31,11 @@ const HYDROPATH = []; if (process.env.NIX_PROFILES) { try { - const result = JSON.parse(child.execSync('nix-env -q --json --out-path --meta').toString()) as Record; - for (const derivation of Object.values(result)) { - if (derivation.name.startsWith('hydro-plugin-') && derivation.outputs?.out) { - HYDROPATH.push(derivation.outputs.out); + const result = JSON.parse(child.execSync('nix profile list --json').toString()) as any; + for (const [name, derivation] of Object.entries(result.elements) as any) { + if (!derivation.active) continue; + if (name.startsWith('hydro-plugin-') && derivation.storePaths) { + HYDROPATH.push(...derivation.storePaths); } } } catch (e) {