mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[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:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user