From a1ffabe4de458517e64b091e0aa4664464a36839 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 25 Apr 2019 17:21:09 +0200 Subject: nixos/window-managers/i3: write config file to `/etc/i3/config` The default config of i3 provides a key binding to reload, so changes take effect immediately: ``` bindsym $mod+Shift+c reload ``` Unfortunately the current module uses the store path of the `configFile` option. So when I change the config in NixOS, a store path will be created, but the current i3 process will continue to use the old one, hence a restart of i3 is required currently. This change links the config to `/etc/i3/config` and alters the X startup script accordingly so after each rebuild, the config can be reloaded. --- nixos/modules/services/x11/window-managers/i3.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/x11/window-managers/i3.nix b/nixos/modules/services/x11/window-managers/i3.nix index c9b0669e7ba..0ef55d5f2c0 100644 --- a/nixos/modules/services/x11/window-managers/i3.nix +++ b/nixos/modules/services/x11/window-managers/i3.nix @@ -60,12 +60,15 @@ in ${cfg.extraSessionCommands} ${cfg.package}/bin/i3 ${optionalString (cfg.configFile != null) - "-c \"${cfg.configFile}\"" + "-c /etc/i3/config" } & waitPID=$! ''; }]; environment.systemPackages = [ cfg.package ] ++ cfg.extraPackages; + environment.etc."i3/config" = mkIf (cfg.configFile != null) { + source = cfg.configFile; + }; }; imports = [ -- cgit 1.4.1