home-manager
home-manager copied to clipboard
bug: sway is broken with custom packages (like swayfx) coming from the nixos configuration
Are you following the right branch?
- [X] My Nixpkgs and Home Manager versions are in sync
Is there an existing issue for this?
- [X] I have searched the existing issues
Issue description
With the changes inside this commit: https://github.com/nix-community/home-manager/commit/3a435342e2e5e2bff1d3331c2bd9e70f25693ea2
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`
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).
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.
If you are the original author of the issue
- If this is resolved, please consider closing it so that the maintainers know not to focus on this.
- If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
- If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
If you are not the original author of the issue
- If you are also experiencing this issue, please add details of your situation to help with the debugging process.
- If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
Memorandum on closing issues
Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.