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/sway: add programs.sway.extraOptions #76437

Merged
merged 1 commit into from Jan 11, 2020
Merged

nixos/sway: add programs.sway.extraOptions #76437

merged 1 commit into from Jan 11, 2020

Conversation

ghost
Copy link

@ghost ghost commented Dec 24, 2019

Motivation for this change

Needed after Optimus PR #66601
In fact sway runs on Intel card in such setup, but it detects nvidia drivers alongside and so refuses to start without magic argument

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @primeos

Copy link
Member

@primeos primeos left a comment

Choose a reason for hiding this comment

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

Hm, tbh I'm not sure what do think of this. I guess this is only/mainly relevant when using the session file with a login manager.

It might be better to add an option like extraOptions (string or e.g. list of strings) to keep it more generic and add examples for verbose, debug, unsupported-gpu (proprietary AMD), and my-next-gpu-wont-be-nvidia (Nvidia).

In fact sway runs on Intel card in such setup, but it detects nvidia drivers alongside and so refuses to start without magic argument

If it does indeed run without proprietary drivers this could qualify for a bug report I guess (maybe one should ask very politely though, especially if the name of a certain company (it who must not be named) is mentioned, which might cause "discomfort" for some readers).

pkgs/applications/window-managers/sway/wrapper.nix Outdated Show resolved Hide resolved
@ghost
Copy link
Author

ghost commented Dec 25, 2019

@primeos

Thank you much for the answer!

I guess this is only/mainly relevant when using the session file with a login manager.

Mainly for that, right.

It might be better to add an option like extraOptions (string or e.g. list of strings) to keep it more generic and add examples for verbose, debug, unsupported-gpu (proprietary AMD), and my-next-gpu-wont-be-nvidia (Nvidia).

Will do! Thanks for suggestion.

If it does indeed run without proprietary drivers this could qualify for a bug report I guess (maybe one should ask very politely though, especially if the name of a certain company (it who must not be named) is mentioned, which might cause "discomfort" for some readers).

Yes, it runs on Intel card. I've created an upstream issue, but I doubt they will invest time into this swaywm/sway#4838

@lovesegfault
Copy link
Member

This is what I used to do to support Bumblebee:
https://github.com/lovesegfault/dotfiles/blob/1a4049e2454543e6f3b856b64432fa63a38d447e/bin/wm#L33-L42

It worked fine at finding an appropriate GPU and forcing it as the Sway one.

@ghost
Copy link

ghost commented Dec 27, 2019

I agree with @primeos: we should not support wrapper options explicitly that are not recommended and/or supported by upstream. On the other hand, I think that providing a extraOptions is a better approach and will give the same result for end-users.

@ghost ghost changed the title nixos/sway: add wrapperFeatures.nvidia nixos/sway: add programs.sway.extraOptions Dec 29, 2019
@ghost ghost requested a review from primeos December 29, 2019 06:24
@ghost
Copy link
Author

ghost commented Jan 9, 2020

@primeos ping

Copy link
Member

@primeos primeos left a comment

Choose a reason for hiding this comment

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

@gnidorah sorry for the delay and thanks for the ping :)

I gave it a test and the build did fail if the GTK wrapper was enabled:

/build/.attr-0: line 11: --add-flags: command not found

I pushed a fix that tries to simplify the wrapProgram mess I've created... :o :D
(And I've added an extra note about opening issues with proprietary drivers as upstream would most likely want us to do this.)
Are you ok with these changes?

@ghost
Copy link
Author

ghost commented Jan 10, 2020

Are you ok with these changes?

Sure. Thank you! 😄

@primeos primeos merged commit 0608d78 into NixOS:master Jan 11, 2020
@primeos
Copy link
Member

primeos commented Jan 11, 2020

Merged, thanks for the PR :)

@ghost
Copy link
Author

ghost commented Jan 11, 2020

@primeos Thank you!

@ghost ghost deleted the sway branch January 11, 2020 11:24
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