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/hyprland: Add systemd.setPath.enable option to include system and user bin directory in PATH #298896

Merged
merged 3 commits into from
Apr 7, 2024

Conversation

JohnRTitor
Copy link
Contributor

@JohnRTitor JohnRTitor commented Mar 25, 2024

Description of changes

This PR adds systemd.setPath.enable option to hyprland module which sets systemd default environment path to include the current system's bin, profile bin and current user's bin.
This is needed in Hyprland only setups, where opening links in applications like VS code do not work without explicitly importing PATH using systemctl.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@JohnRTitor
Copy link
Contributor Author

@wozeparrot @fufexan Hyprland package maintainers

Copy link
Contributor

@fufexan fufexan left a comment

Choose a reason for hiding this comment

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

LGTM.

One thing though, mdDoc is now the default and can be omitted. Can you perhaps also remove any occurrence of it in a separate commit?

@JohnRTitor
Copy link
Contributor Author

Done. Also added possible binary dirs such as the user packages bin, profiles/default/bin...

@fufexan please check.

Copy link
Contributor

@fufexan fufexan left a comment

Choose a reason for hiding this comment

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

The commits should start with nixos/hyprland: ... and possibly have more concise titles. Further explanations can go into the commit message.

nixos/modules/programs/wayland/hyprland.nix Outdated Show resolved Hide resolved
@fufexan
Copy link
Contributor

fufexan commented Mar 28, 2024

Commit names still aren't fixed.

@JohnRTitor
Copy link
Contributor Author

JohnRTitor commented Mar 28, 2024

How do I amend previously created commits? git commit --amend only amends the latest commit.

@fufexan
Copy link
Contributor

fufexan commented Mar 28, 2024

You can do git rebase --interactive HEAD~4 to select the latest 4 commits (your commits), and change the pick keyword to reword. Then git will prompt you to edit each of the commits' messages.

@JohnRTitor
Copy link
Contributor Author

JohnRTitor commented Mar 28, 2024

Thanks for the tip :) I have updated the commit titles. Please check.

@JohnRTitor JohnRTitor changed the title hyprland: set systemd path to include current system bin directory by default nixos/hyprland: Add systemd.setPath.enable option to include system and user bin directory in PATH Mar 28, 2024
@fufexan
Copy link
Contributor

fufexan commented Mar 28, 2024

The last two commits can be squashed into one. Using the same rebase mechanism, switch the last commit from pick to squash.

@JohnRTitor
Copy link
Contributor Author

Done. Thanks :)

Copy link
Contributor

@fufexan fufexan left a comment

Choose a reason for hiding this comment

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

LGTM

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/prs-ready-for-review/3032/3716

This commit adds systemd.setPath.enable option to hyprland module
which sets the systemd path to include the current system's bin
This is needed in Hyprland only setups, where opening links in applications like VS code do not work.
If user chooses, they can `exec-once=dbus-update-activation-environment --systemd --all` in hyprland.conf
To import all path variables from the system's environment to systemd's environment

Also set option example to false
@JohnRTitor
Copy link
Contributor Author

@wegank I just rebased it :) no new changes

@JohnRTitor
Copy link
Contributor Author

@Mic92 could you please review it? Fufexan approved this change but still need a commiter to merge.

@Mic92 Mic92 merged commit 1155526 into NixOS:master Apr 7, 2024
21 checks passed
@Schweber
Copy link
Contributor

Since this was merged i get the following:

$ kitty sh hx                                                                                                                               
[104 15:36:23.528696] [glfw error 65544]: process_desktop_settings: failed with error: [org.freedesktop.DBus.Error.UnknownMethod] No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop

It worked fine before. Might this be caused by this PR or is this unrelated?

@JohnRTitor
Copy link
Contributor Author

JohnRTitor commented Apr 13, 2024

It worked fine before. Might this be caused by this PR or is this unrelated?

Working for me. Weird.
I might have misunderstood the issue.
Please explain what is the expected behaviour.
I don't see any output like that in stdout/err if I run that command.
Kitty launches for a second and closes instantly.

Note: you can disable this by setting the following in your configuration.nix:

programs.hyprland.systemd.setPath.enable = false;

@Schweber
Copy link
Contributor

Schweber commented Apr 14, 2024

Kitty launches for a second and closes instantly.

Exactly. Before, the window stayed open as intended. When i first run kitty and then run hx in the kitty window, it stays open as before.

foot sh hx shows the same behaviour but without the error output. So i guess the problem is not caused by kitty.

Note: you can disable this by setting the following in your configuration.nix:

programs.hyprland.systemd.setPath.enable = false;

Sorry, i didn't think of that. I disabled it and the behaviour is still there. So i guess my problem is unrelated to this PR, sorry.

@Schweber Schweber mentioned this pull request Apr 15, 2024
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.

7 participants