KSA on Linux assumes path relative to executable is writable

Ben Gamari

New Member
Feb 26, 2026
3
2

Game Version

v2026.2.35.3667

Operating System

Linux

What Happened​

Attempting to run KSA on NixOS with [nixos/nixpkgs#492242](https://github.com/NixOS/nixpkgs/pull/492242) reveals that KSA assumes that it can create a directory relative to the executables's location:
Code:
Unhandled exception. System.IO.FileNotFoundException: Could not find file '/nix/store/km2nrjr306ydgrm2d8g8r6x9yaiilyig-ksa-2026.2.35.3667/share/ksa/My Games'.
File name: '/nix/store/km2nrjr306ydgrm2d8g8r6x9yaiilyig-ksa-2026.2.35.3667/share/ksa/My Games'
   at System.IO.FileSystem.CreateParentsAndDirectory(String fullPath, UnixFileMode unixCreateMode)
   at System.IO.FileSystem.CreateDirectory(String fullPath, UnixFileMode unixCreateMode)
   at System.IO.Directory.CreateDirectory(String path)
   at KSA.Program..ctor(IReadOnlyList`1 inArgs)
   at KSA.Program.Main(String[] inArgs)
If this behavior is necessary then the location should be configurable with an environment variable (or, even better, respect XDG).

What Was Expected​

It doesn't crash.

Reproduction Steps​

  1. Code:
    NIXPKGS_ALLOW_UNFREE=1 nix run github:Leha44581/nixpkgs/ksa#ksa --impure

Reproduction Rate​

Always

Additional Info​

  • Video/Screenshots: [Link or attach files]
  • Save File: [Attached/Link to save file if relevant]
  • Other Notes: [Any other relevant details]
 
Upvote 0
I suspect this would be a low priority issue for now. And later it will heavily depend on distribution format and complexity/unification tradeoffs.

In stadard XDG model, config/saves would go to a game subdir under (In shell notation) ${XDG_CONFIG_HOME:-"${HOME}/.config"}
Or separate saves into ${XDG_STATE_HOME:-"${HOME}/.local/state"}, but that may be too pedantic.

Data would be searched (and merged) across game subdir(s) in ./:${XDG_DATA_HOME:-"${HOME}/.local/share"}:${XDG_DATA_DIRS:-"/usr/local/share:/usr/share"}, expecting only RO access. Home part of data hierarchy would be the perfect place for mods.