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.
This commit is contained in:
Maximilian Bosch 2019-04-25 17:21:09 +02:00
parent 5d2775156b
commit a1ffabe4de
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E

View File

@ -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 = [