FAForever / FAForever/faf-linux

Autodetect NixOS and relaunch

Open
#38 3 comments 1 reaction 1 assignee Claimed by @iczero View on GitHub
Dominant language
Shell
Stars
125
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Nix can start the Steam FHS environment with the additional required packages directly from `nix-shell`. Scripts can autodetect a NixOS environment and reexec, instead of requiring the user to manually specify packages.

The following was from lilijoyskyseeker on the FAF Discord.

# SOLVED https://discord.com/channels/197033481883222026/1228471001633914950

Instead of running in the Ubuntu Distrobox, run it on NixOS with this:
1. Make sure Steam is installed this way in your `configuration.nix`
```nix
# steam
programs.steam = {
enable = true;
};
```
2. add
```nix
# steam
programs.steam = {
enable = true;
# this here \/\/\/
package = with pkgs; steam.override { extraPkgs = pkgs: [
jq
cabextract
wget
]; };
# this here /\/\/\
};
```
3. rebuild your system
4. run the `setup.sh` with `steam-run bash ""` (if you get spammed with a popup, just spam click OK)
5. follow the rest of the setup on the wiki substituting the command with being run with `steam-run bash ""`
6. Profit!
7. if you want you GUI to be able to launch the game after running `install-shortcut.sh`, find the `.desktop` file, mine was at `~/.local/share/application/com.faforever.faf-linux.desktop`, and edit the `Exec` line to this: `Exec=steam-run bash ""`
8. More profit!

many thanks again to <@261580158798921740>

maybe
```
nix-shell -p steam-run jq cabextract wget --run "steam-run bash ''"
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.