···1212 # Install the desktop file:
1313 env.Install("$DESTDIR$PREFIX/share/applications", "endless-sky.desktop")
1414diff --git a/source/Files.cpp b/source/Files.cpp
1515-index de27023e..4225051f 100644
1515+index f5dec21..ad57c55 100644
1616--- a/source/Files.cpp
1717+++ b/source/Files.cpp
1818-@@ -108,32 +108,9 @@ void Files::Init(const char * const *argv)
1919- resources = str;
2020- SDL_free(str);
1818+@@ -115,6 +115,7 @@ void Files::Init(const char * const *argv)
1919+ else if(IsParent(STANDARD_PATH, resources))
2020+ resources = STANDARD_PATH / RESOURCE_PATH;
2121+ #endif
2222++ resources = "%NIXPKGS_RESOURCES_PATH%";
2123 }
2222--#if defined _WIN32
2323-- FixWindowsSlashes(resources);
2424--#endif
2525-- if(resources.back() != '/')
2626-- resources += '/';
2727--#if defined __linux__ || defined __FreeBSD__ || defined __DragonFly__
2828-- // Special case, for Linux: the resource files are not in the same place as
2929-- // the executable, but are under the same prefix (/usr or /usr/local).
3030-- static const string LOCAL_PATH = "/usr/local/";
3131-- static const string STANDARD_PATH = "/usr/";
3232-- static const string RESOURCE_PATH = "share/games/endless-sky/";
3333-- if(!resources.compare(0, LOCAL_PATH.length(), LOCAL_PATH))
3434-- resources = LOCAL_PATH + RESOURCE_PATH;
3535-- else if(!resources.compare(0, STANDARD_PATH.length(), STANDARD_PATH))
3636-- resources = STANDARD_PATH + RESOURCE_PATH;
3737--#endif
3838-- // If the resources are not here, search in the directories containing this
3939-- // one. This allows, for example, a Mac app that does not actually have the
4040-- // resources embedded within it.
4141-- while(!Exists(resources + "credits.txt"))
4242-- {
4343-- size_t pos = resources.rfind('/', resources.length() - 2);
4444-- if(pos == string::npos || pos == 0)
4545-- throw runtime_error("Unable to find the resource directories!");
4646-- resources.erase(pos + 1);
4747-- }
4848-+
4949-+ resources = "%NIXPKGS_RESOURCES_PATH%";
5050-+
5151- dataPath = resources + "data/";
5252- imagePath = resources + "images/";
5353- soundPath = resources + "sounds/";
2424+ // If the resources are not here, search in the directories containing this
2525+ // one. This allows, for example, a Mac app that does not actually have the