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

xmonad: add support for v0.17.0 #2522

Merged
merged 1 commit into from Dec 14, 2021
Merged

Conversation

NickHu
Copy link
Collaborator

@NickHu NickHu commented Dec 1, 2021

Description

Starting from
~v0.17.0,
xmonad moved the location of its recompile output binary. This change
accommodates that. We might want to drop support for v0.15.0 at some point,
when it hits stackage LTS making haskellPackages.xmonad resolve to v0.17.0
(currently, it does not, although there is a separate
haskellPackages.xmonad_0_17_0).

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

@NickHu NickHu requested a review from rycee as a code owner December 1, 2021 12:04
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/use-latest-version-of-xmonad-0-17-0/16191/13

Copy link
Member

@berbiche berbiche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Where does xmonad save its file when it recompiles the program now?
The symlink might have to be changed here:

home.file.".xmonad/xmonad.hs".source = cfg.config;
home.file.".xmonad/xmonad-${pkgs.hostPlatform.system}" = {
source = xmonadBin;
onChange = ''
# Attempt to restart xmonad if X is running.
if [[ -v DISPLAY ]]; then
${config.xsession.windowManager.command} --restart
fi
'';
};

@NickHu
Copy link
Collaborator Author

NickHu commented Dec 2, 2021

It moved from $XMONAD_DATA_DIR to $XMONAD_CACHE_DIR:

https://github.com/nix-community/home-manager/pull/2522/files#diff-47cbc76991d0d9b568f0f62b0b31aee6f69652b7302a7e1836e7adbe65041cc5R135-R141

The snippet you linked is just about where home-manager links the output of this, so it doesn't require any changes.

Copy link
Member

@berbiche berbiche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mentalblock
Copy link

mentalblock commented Dec 6, 2021

If we change xmonad to use XDG (available since 0.17) then we would need to symlink the compiled binary to XDG_CACHE_HOME, see:

* https://github.com/xmonad/xmonad/blob/eb2ee340e4180d1f7741605d846b154e777b509b/src/XMonad/Core.hs#L501-L545

* https://github.com/xmonad/xmonad/blob/eb2ee340e4180d1f7741605d846b154e777b509b/src/XMonad/Core.hs#L562-L564

Ahhh. I think I understand what you mean. The symlink should now be something like

home.file."${config.xdg.cacheHome}/xmonad/xmonad-${pkgs.hostPlatform.system}" = { ...

for xmonad 0.17.

I do not know Nix that well so what would be the idiomatic way to make this conditional predicated on the version of xmonad?

EDIT: Fixed symlink path.

@mentalblock
Copy link

Can we merge this as is and fix the XDG path after 0.17.0 is the default version?

@NickHu
Copy link
Collaborator Author

NickHu commented Dec 14, 2021

@berbiche Oh, I see, you are proposing a bigger change where we transition to using XDG. As is, the patch currently works because the module explicitly sets XMONAD_*_DIR.

I agree with what @mentalblock said: it's probably best to wait until 0.17.0 is the default version to incorporate this larger change.

@berbiche
Copy link
Member

Alright 👍

@berbiche berbiche merged commit c61fc1c into nix-community:master Dec 14, 2021
adomixaszvers pushed a commit to adomixaszvers/home-manager that referenced this pull request Dec 15, 2021
@NickHu NickHu deleted the xmonad branch December 15, 2021 11:27
adomixaszvers pushed a commit to adomixaszvers/home-manager that referenced this pull request Dec 20, 2021
adomixaszvers pushed a commit to adomixaszvers/home-manager that referenced this pull request Feb 5, 2022
adomixaszvers pushed a commit to adomixaszvers/home-manager that referenced this pull request Apr 8, 2022
adomixaszvers pushed a commit to adomixaszvers/home-manager that referenced this pull request May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants