I love NixOS, but have some troubles with running Spotify on it. I’ve declared it in my home-manager:
packages = [
pkgs.spotify
];
When I run it and click “log in” button, first nothing happens, but when I click it the second time it says “Go to your browser to log in”, which it should do, but no browser window pops out…
[root@dell-3:~]# nixos-rebuild switch --flake /etc/nixos#default
building the system configuration...
error:
… while calling the 'head' builtin
at /nix/store/8fwsiv0hd7nw1brkvka0jf1frk3m7qkr-source/lib/attrsets.nix:1574:11:
1573| || pred here (elemAt values 1) (head values) then
1574| head values
| ^
1575| else
… while evaluating the attribute 'value'
at /nix/store/8fwsiv0hd7nw1brkvka0jf1frk3m7qkr-source/lib/modules.nix:846:9:
845| in warnDeprecation opt //
846| { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
847| inherit (res.defsFinal') highestPrio;
… while evaluating the option `system.build.toplevel':
… while evaluating definitions from `/nix/store/8fwsiv0hd7nw1brkvka0jf1frk3m7qkr-source/nixos/modules/system/activation/top-level.nix':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error:
Failed assertions:
- Setting xdg.portal.enable to true requires a portal implementation in xdg.portal.extraPortals such as xdg-desktop-portal-gtk or xdg-desktop-portal-kde.
[root@dell-3:~]#
building the system configuration...
evaluation warning: xdg-desktop-portal 1.17 reworked how portal implementations are loaded, you
should either set `xdg.portal.config` or `xdg.portal.configPackages`
to specify which portal backend to use for the requested interface.
https://github.com/flatpak/xdg-desktop-portal/blob/37a6f7c8b8e08b9861f05e172cd4e0d07a832c4d/doc/portals.conf.rst.in
If you simply want to keep the behaviour in < 1.17, which uses the first
portal implementation found in lexicographical order, use the following:
xdg.portal.config.common.default = "*";
That is why I was trying to use configPackages. Is it possible?
I was having a similar problem with the spotify package (no window popping out). Temporarily setting my default browser to firefox fixed? this issue for me for now. FYI i was using zen browser in flatpak before this
Hi, I temporarily installed Firefox from Flatpak and Spotify using nix-shell. After running Spotify and clicking “Log in” I get this error:
[jeansib@dell-1:~]$ export NIXPKGS_ALLOW_UNFREE=1
[jeansib@dell-1:~]$ nix-shell -p spotify
[nix-shell:~]$ spotify
/run/current-system/sw/bin/flatpak: /nix/store/g365mj7mxp4w5ig63fhwk0c9x0ji27vb-curl-8.11.0/lib/libcurl.so.4: version `CURL_OPENSSL_4' not found (required by /run/current-system/sw/bin/flatpak)
/run/current-system/sw/bin/flatpak: /nix/store/g365mj7mxp4w5ig63fhwk0c9x0ji27vb-curl-8.11.0/lib/libcurl.so.4: version `CURL_OPENSSL_4' not found (required by /nix/store/m7skd61h5dn0sj6jd148rxmpnva6fswf-appstream-1.0.3/lib/libappstream.so.5)
/run/current-system/sw/bin/flatpak: /nix/store/g365mj7mxp4w5ig63fhwk0c9x0ji27vb-curl-8.11.0/lib/libcurl.so.4: version `CURL_OPENSSL_4' not found (required by /nix/store/swncwmgsqqk7sxz21q96szgza3dd1i0x-ostree-2024.8/lib/libostree-1.so.1)
[nix-shell:~]$
Note that after typing “spotify” there is no output until I click the “Log in” button.
Okay, with Firefox installed as a nix package it works. But as Flatpak Spotify seems to be working I think I’ll stick to that. Thank you for your help!