2021-04-08 11:35:51 +01:00
|
|
|
From 92283df3acbffa5c1bb21f23cdd686113d905114 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Patrick Hilhorst <git@hilhorst.be>
|
|
|
|
Date: Wed, 31 Mar 2021 21:14:13 +0200
|
2019-04-27 21:38:18 +01:00
|
|
|
Subject: [PATCH] Load configs from /etc but fallback to /nix/store
|
|
|
|
|
|
|
|
This change will load all configuration files from /etc, to make it easy
|
|
|
|
to override them, but fallback to /nix/store/.../etc/sway/config to make
|
|
|
|
Sway work out-of-the-box with the default configuration on non NixOS
|
|
|
|
systems.
|
2021-04-08 11:35:51 +01:00
|
|
|
|
|
|
|
Original patch by Michael Weiss, updated for Sway 1.6 by Patrick Hilhorst
|
|
|
|
|
|
|
|
Co-authored-by: Michael Weiss <dev.primeos@gmail.com>
|
2019-04-27 21:38:18 +01:00
|
|
|
---
|
|
|
|
meson.build | 3 ++-
|
2021-04-08 11:35:51 +01:00
|
|
|
sway/config.c | 3 ++-
|
|
|
|
2 files changed, 4 insertions(+), 2 deletions(-)
|
2019-04-27 21:38:18 +01:00
|
|
|
|
|
|
|
diff --git a/meson.build b/meson.build
|
2021-04-08 11:35:51 +01:00
|
|
|
index b7a29660..8ae8ceb3 100644
|
2019-04-27 21:38:18 +01:00
|
|
|
--- a/meson.build
|
|
|
|
+++ b/meson.build
|
2021-04-08 11:35:51 +01:00
|
|
|
@@ -164,7 +164,8 @@ if scdoc.found()
|
2019-04-27 21:38:18 +01:00
|
|
|
endforeach
|
|
|
|
endif
|
|
|
|
|
|
|
|
-add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
|
|
|
|
+add_project_arguments('-DSYSCONFDIR="/@0@"'.format(sysconfdir), language : 'c')
|
|
|
|
+add_project_arguments('-DNIX_SYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
|
|
|
|
|
|
|
|
version = '"@0@"'.format(meson.project_version())
|
2021-04-08 11:35:51 +01:00
|
|
|
git = find_program('git', native: true, required: false)
|
2019-04-27 21:38:18 +01:00
|
|
|
diff --git a/sway/config.c b/sway/config.c
|
2021-04-08 11:35:51 +01:00
|
|
|
index 76b9ec08..fb5b51aa 100644
|
2019-04-27 21:38:18 +01:00
|
|
|
--- a/sway/config.c
|
|
|
|
+++ b/sway/config.c
|
2021-04-08 11:35:51 +01:00
|
|
|
@@ -374,7 +374,8 @@ static char *get_config_path(void) {
|
|
|
|
{ .prefix = home, .config_folder = ".i3"},
|
|
|
|
{ .prefix = config_home, .config_folder = "i3"},
|
|
|
|
{ .prefix = SYSCONFDIR, .config_folder = "sway"},
|
|
|
|
- { .prefix = SYSCONFDIR, .config_folder = "i3"}
|
|
|
|
+ { .prefix = SYSCONFDIR, .config_folder = "i3"},
|
|
|
|
+ { .prefix = NIX_SYSCONFDIR, .config_folder = "sway"},
|
2019-04-27 21:38:18 +01:00
|
|
|
};
|
|
|
|
|
2021-04-08 11:35:51 +01:00
|
|
|
size_t num_config_paths = sizeof(config_paths)/sizeof(config_paths[0]);
|
2019-04-27 21:38:18 +01:00
|
|
|
--
|
2021-04-08 11:35:51 +01:00
|
|
|
2.30.1
|