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

@gnidorah
Copy link
Contributor

@gnidorah gnidorah 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

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
@gnidorah
Copy link
Contributor Author

@gnidorah gnidorah 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
Contributor

@lovesegfault lovesegfault commented Dec 26, 2019

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.

@Elyhaka
Copy link
Contributor

@Elyhaka Elyhaka 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.

@gnidorah gnidorah force-pushed the gnidorah:sway branch from 6c90930 to 27a990e Dec 29, 2019
@gnidorah gnidorah changed the title nixos/sway: add wrapperFeatures.nvidia nixos/sway: add programs.sway.extraOptions Dec 29, 2019
@gnidorah gnidorah requested a review from primeos Dec 29, 2019
@gnidorah
Copy link
Contributor Author

@gnidorah gnidorah commented Jan 9, 2020

@primeos ping

@primeos primeos force-pushed the gnidorah:sway branch from 27a990e to ad8a430 Jan 9, 2020
@primeos
primeos approved these changes Jan 9, 2020
Copy link
Member

@primeos primeos left a comment

@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?

@gnidorah
Copy link
Contributor Author

@gnidorah gnidorah commented Jan 10, 2020

Are you ok with these changes?

Sure. Thank you! 😄

@primeos primeos merged commit 0608d78 into NixOS:master Jan 11, 2020
13 checks passed
13 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@primeos
Copy link
Member

@primeos primeos commented Jan 11, 2020

Merged, thanks for the PR :)

@gnidorah
Copy link
Contributor Author

@gnidorah gnidorah commented Jan 11, 2020

@primeos Thank you!

@gnidorah gnidorah deleted the gnidorah:sway branch Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.