nixpkgs/pkgs/tools/misc/calamares/nixos-extensions-paths.patch

47 lines
1.5 KiB
Diff

diff --git a/src/calamares/main.cpp b/src/calamares/main.cpp
index de709156f..a0b6c5faf 100644
--- a/src/calamares/main.cpp
+++ b/src/calamares/main.cpp
@@ -131,6 +132,8 @@ main( int argc, char* argv[] )
// TODO: umount anything in /tmp/calamares-... as an emergency save function
#endif
+ CalamaresUtils::setNixosDirs();
+
bool is_debug = handle_args( a );
#ifdef WITH_KF5DBus
diff --git a/src/libcalamares/utils/Dirs.cpp b/src/libcalamares/utils/Dirs.cpp
index f333d6e64..6118fb412 100644
--- a/src/libcalamares/utils/Dirs.cpp
+++ b/src/libcalamares/utils/Dirs.cpp
@@ -115,6 +116,14 @@ setXdgDirs()
s_haveExtraDirs = !( s_extraConfigDirs.isEmpty() && s_extraDataDirs.isEmpty() );
}
+void
+setNixosDirs()
+{
+ s_extraConfigDirs << "/run/current-system/sw/share/calamares/";
+ s_extraDataDirs << "/run/current-system/sw/share/calamares/";
+ s_haveExtraDirs = !( s_extraConfigDirs.isEmpty() && s_extraDataDirs.isEmpty() );
+}
+
QStringList
extraConfigDirs()
{
diff --git a/src/libcalamares/utils/Dirs.h b/src/libcalamares/utils/Dirs.h
index 445cbe1f1..da869d446 100644
--- a/src/libcalamares/utils/Dirs.h
+++ b/src/libcalamares/utils/Dirs.h
@@ -50,6 +50,9 @@ DLLEXPORT bool isAppDataDirOverridden();
/** @brief Setup extra config and data dirs from the XDG variables.
*/
DLLEXPORT void setXdgDirs();
+/** @brief Setup extra config and data dirs fir NixOS.
+ */
+DLLEXPORT void setNixosDirs();
/** @brief Are any extra directories configured? */
DLLEXPORT bool haveExtraDirs();
/** @brief XDG_CONFIG_DIRS, each guaranteed to end with / */