Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/window-managers/i3: write config file to /etc/i3/config #60223

Merged
merged 1 commit into from Apr 27, 2019

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Apr 25, 2019

Motivation for this change

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.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@teto
Copy link
Member

teto commented Apr 26, 2019

LGTM. Now needs to fix the issue :)

@Ma27
Copy link
Member Author

Ma27 commented Apr 26, 2019

Hmm yeah, I'm not 100% sure why the evaluation fails right now as I'm already using the change on my laptop, but I'll have a look at this tonight :)

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.
@Ma27
Copy link
Member Author

Ma27 commented Apr 26, 2019

Ok seems as I messed up. With configFile being null an evaluation error was thrown previously. Now the config file in /etc will only linked if configFile != null.

@teto teto merged commit 03fb00d into NixOS:master Apr 27, 2019
@Ma27 Ma27 deleted the write-i3cfg-to-etc branch April 27, 2019 11:00
@teto
Copy link
Member

teto commented Apr 27, 2019

there is sthg similar at #60319 I believe except he uses mkDefault so that the config can be overriden. This PR might break some configs, thus the addition may be needed ?

@Ma27
Copy link
Member Author

Ma27 commented Apr 27, 2019

so that the config can be overriden. This PR might break some configs, thus the addition may be needed ?

You mean that /etc/i3/config is overrideable? I don't think that this is needed. In contrast to the sway module which seems to have used a config, i3 never used /etc/i3/config before, you could only set configs by using the configFile option, for anything else you'd have to override the script in the X startup script.

Or am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants