Skip to content

Commit dfe63e5

Browse files
authored
[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
1 parent 207d3c7 commit dfe63e5

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/main/services/linux.service.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,7 @@ export class LinuxService {
129129
return fs.pathExistsSync(protonPath) && fs.pathExistsSync(winePath);
130130
}
131131

132-
public async getWinePath(): Promise<string> {
133-
if (await this.isNixOS()) {
134-
// Use system wine for nixos
135-
return "wine";
136-
}
137-
132+
public getWinePath(): string {
138133
if (!this.staticConfig.has("proton-folder")) {
139134
throw new Error("proton-folder variable not set");
140135
}

src/main/services/mods/bs-mods-manager.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,22 @@ export class BsModsManagerService {
162162
let winePath: string = "";
163163
if (process.platform === "linux") {
164164
const { error: winePathError, result: winePathResult } =
165-
await tryit(async () => this.linuxService.getWinePath());
165+
tryit(() => this.linuxService.getWinePath());
166166
if (winePathError) {
167167
log.error(winePathError);
168168
return false;
169169
}
170-
winePath = `"${winePathResult}"`;
170+
171+
winePath = await this.linuxService.isNixOS()
172+
? `steam-run "${winePathResult}"`
173+
: `"${winePathResult}"`;
171174

172175
const winePrefix = this.linuxService.getWinePrefixPath();
173176
if (!winePrefix) {
174177
throw new CustomError("Could not find BSManager WINEPREFIX path", "no-wineprefix");
175178
}
176179
env.WINEPREFIX = winePrefix;
180+
Object.assign(env, process.env);
177181
}
178182

179183
return new Promise<boolean>(resolve => {

0 commit comments

Comments
 (0)