[bugfix] Fix mod installation on NixOS (#870)

* fix(services/bs-mods-manager): inherit env on linux when starting bsipa

* fix(services/linux,bs-mods-manager): use proton wine on nixos
This commit is contained in:
Sapphire
2025-06-08 08:43:06 -05:00
committed by GitHub
parent 207d3c782e
commit dfe63e525e
2 changed files with 7 additions and 8 deletions
+1 -6
View File
@@ -129,12 +129,7 @@ export class LinuxService {
return fs.pathExistsSync(protonPath) && fs.pathExistsSync(winePath);
}
public async getWinePath(): Promise<string> {
if (await this.isNixOS()) {
// Use system wine for nixos
return "wine";
}
public getWinePath(): string {
if (!this.staticConfig.has("proton-folder")) {
throw new Error("proton-folder variable not set");
}
@@ -162,18 +162,22 @@ export class BsModsManagerService {
let winePath: string = "";
if (process.platform === "linux") {
const { error: winePathError, result: winePathResult } =
await tryit(async () => this.linuxService.getWinePath());
tryit(() => this.linuxService.getWinePath());
if (winePathError) {
log.error(winePathError);
return false;
}
winePath = `"${winePathResult}"`;
winePath = await this.linuxService.isNixOS()
? `steam-run "${winePathResult}"`
: `"${winePathResult}"`;
const winePrefix = this.linuxService.getWinePrefixPath();
if (!winePrefix) {
throw new CustomError("Could not find BSManager WINEPREFIX path", "no-wineprefix");
}
env.WINEPREFIX = winePrefix;
Object.assign(env, process.env);
}
return new Promise<boolean>(resolve => {