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

bug: sway is broken with custom packages (like swayfx) coming from the nixos configuration #5307

Open
2 tasks done
ElysaSrc opened this issue Apr 20, 2024 · 1 comment
Open
2 tasks done
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@ElysaSrc
Copy link

ElysaSrc commented Apr 20, 2024

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

With the changes inside this commit: 3a43534

If you have a programs.sway with custom configurations at nixos level, and you put a package = null to use the os level package, it cannot validates the configuration since it will wrongly use pkgs.sway and not the nixos defined one.

To reproduce, you can have this in your nixos configuration.nix file:

    programs = {
      sway = {
        enable = true;
        package = pkgs.swayfx;
        extraSessionCommands = ''
          export SDL_VIDEODRIVER=wayland
          export MOZ_ENABLE_WAYLAND=1
          export NIXOS_OZONE_WL=1
          export QT_QPA_PLATFORM=wayland-egl
          export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
          export _JAVA_AWT_WM_NONREPARENTING=1
          export SSH_ASKPASS_REQUIRE=prefer
          export SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
        '';
        extraPackages = [];
      };
    };

and if on your home you put this:

wayland.windowManager.sway = {
   enable = true;
   package = null;
   # ...
};

The configuration will fail if you use SwayFX settings, like "blur" and stuff.

Workaround : set checkConfig = false;.
Fix : Use correctly the sway coming from the nixos configuration itself.

Maintainer CC

@amarshall @rycee

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.8.6, NixOS, 24.05 (Uakari), 24.05.20240419.5c24cf2`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/nix/store/v4pcs3nzx54m5bmxd39win0rgl2d2hbx-source`
@ElysaSrc ElysaSrc added bug triage Issues or feature request that have not been triaged yet labels Apr 20, 2024
amarshall added a commit to amarshall/home-manager that referenced this issue Apr 20, 2024
- Implicitly disable checkConfig when `cfg.package = null` as we don’t
  have any exe to use for the check
- Implicitly disable `swaymsg reload` on activation, since we have no
  exe to use for running it

See nix-community#5307
amarshall added a commit to amarshall/home-manager that referenced this issue Apr 20, 2024
- Implicitly disable checkConfig when `cfg.package = null` as we don’t
  have any exe to use for the check
- Implicitly disable `swaymsg reload` on activation, since we have no
  exe to use for running it

See nix-community#5307
@amarshall
Copy link
Contributor

Fix: Use correctly the sway coming from the nixos configuration itself

It’s not possible for Home Manager to do this itself, you need to do it in NixOS config with e.g. in your NixOS config home-manager.sharedModules = [{ programs.sway.package = …; }];. This is assuming you’re building HM config via the HM NixOS module.


I do think that HM should probably not implicitly turn package = null into pkgs.sway for select things; here’s a PR for that (not tested too much, please try it out).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

5 participants