WillPower3309 / swayfx

SwayFX: Sway, but with eye candy!
MIT License
1.29k stars 48 forks source link

NixOS error when setting programs.sway.package = pkgs.swayfx #161

Closed WillPower3309 closed 8 months ago

WillPower3309 commented 1 year ago

Setting programs.sway.package = pkgs.swayfx in a Nix config will result in the following error:

error: Package, 'swayfx-0.2', did not specify any session names, as strings, in
       'passthru.providedSessions'. This is required when used as a session package.

       The session names can be looked up in:
         /nix/store/704ch74d0hh687ai5idcrwix3xcdwgn9-swayfx-0.2/share/xsessions
         /nix/store/704ch74d0hh687ai5idcrwix3xcdwgn9-swayfx-0.2/share/wayland-sessions
(use '--show-trace' to show detailed location information)

The swayfx nix package definition should include this session name

vegaelle commented 1 year ago

Is there a workaround to make it work currently?

amaali7 commented 1 year ago

Is there a workaround to make it work currently?

Hi you can use this config for now

programs.sway = { enable = true; package = (pkgs.swayfx.overrideAttrs (old: { passthru.providedSessions = [ "sway" ]; }));};

it solve the problem for me :)

TotalChaos05 commented 1 year ago

it worked for me without needing that, is it fixed now?

WillPower3309 commented 1 year ago

it worked for me without needing that, is it fixed now?

Were you using home-manager? Looks like it still isn't working

TotalChaos05 commented 1 year ago

I was, but i also made a test flake without it what version of nixpkgs do you use?

name-snrl commented 9 months ago

If https://github.com/NixOS/nixpkgs/pull/267261 and https://github.com/NixOS/nixpkgs/pull/267261 are merged, it will be solved

WillPower3309 commented 9 months ago

If https://github.com/NixOS/nixpkgs/pull/267261 and https://github.com/NixOS/nixpkgs/pull/267261 are merged, it will be solved

Thanks for getting a fix up on the nix side! I think you may have linked the same PR twice

name-snrl commented 9 months ago

twice

Oops, https://github.com/NixOS/nixpkgs/pull/234243

TLATER commented 9 months ago

AIUI, those will fix the issue upstream in nixpkgs, but the flake in this repository still needs to be updated. Don't think much can be done until the dust settles on how sway forks will be used by the nixpkgs module, though.

kira-bruneau commented 9 months ago

This should be fixed now since https://github.com/NixOS/nixpkgs/pull/270013 was merged!

EDIT: Oops spoke to soon, still need https://github.com/NixOS/nixpkgs/pull/267261

WillPower3309 commented 9 months ago

This should be fixed now since https://github.com/NixOS/nixpkgs/pull/270013 was merged!

EDIT: Oops spoke to soon, still need https://github.com/NixOS/nixpkgs/pull/267261

Thanks a ton for helping out! I'll monitor that pull request

RicArch97 commented 8 months ago

Fixed in https://github.com/NixOS/nixpkgs/pull/273762. Tested in my own config, and setting programs.sway.package = pkgs.swayfx now correctly wraps the binary, which fixes the session error.

name-snrl commented 8 months ago

Tested in my own config

idk what you're talking about, hardcoded is still present in the module:

https://github.com/NixOS/nixpkgs/blob/b21d62223e01fa300390b7fe5531bc664b34fc99/nixos/modules/programs/wayland/sway.nix#L29-L56

This means that if you export some variable in programs.sway.extraSessionCommands, for example, it will not appear in your env.

eclairevoyant commented 8 months ago

You can override it yourself in the .package option instead.

Anyway the fix is in two parts, one part has merged, the other hasn't.

name-snrl commented 8 months ago

option instead

I know, but what the reason to use module then?

RicArch97 commented 8 months ago

idk what you're talking about, hardcoded is still present in the module

The change fixed the problem described in this issue. It's true that the module needs a change as well, but that's a different issue imo

RicArch97 commented 8 months ago

Now really resolved with https://github.com/NixOS/nixpkgs/pull/267261 merged 🎉

WillPower3309 commented 8 months ago

Big thanks to @kira-bruneau for a great first stab at the issue and getting things organized, and @name-snrl and @quantenzitrone for implementing this in nixpkgs! Happy to announce this is completed :)

Raagh commented 4 months ago

I am still encountering this with a newer version of the package ` error: Package, 'swayfx-0.3.2', did not specify any session names, as strings, in 'passthru.providedSessions'. This is required when used as a session package.

   The session names can be looked up in:
     /nix/store/38j434zdrdzkixp1d81flfrhpzz3y1p1-swayfx-0.3.2/share/xsessions
     /nix/store/38j434zdrdzkixp1d81flfrhpzz3y1p1-swayfx-0.3.2/share/wayland-sessions

` the override workaround works but I am curious if this is a regression or am I doing something wrong.

programs.sway = { enable = true; package = pkgs.swayfx; wrapperFeatures.gtk = true; };