nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.91k stars 1.8k forks source link

Can't override Firefox package anymore #2010

Closed cideM closed 3 years ago

cideM commented 3 years ago

Issue description

  programs.firefox.enable = true;
  programs.firefox.package = pkgs.firefox-devedition-bin;

This used to work but right now it gives me:

$ sudo nixos-rebuild switch --flake .
warning: Git tree '/home/tifa/dotfiles' is dirty
building the system configuration...
warning: Git tree '/home/tifa/dotfiles' is dirty
error: builder for '/nix/store/sfw05l85h9silyhgypishjsx6z7z2rnc-firefox-devedition-bin-85.0b6.drv' failed with exit code 1;
       last 1 log lines:
       > cannot find executable file `/nix/store/r5c5mj2z8h8k744jzpycxmzqsabq232n-firefox-devedition-bin-85.0b6/bin/firefox-devedition-bin'
       For full logs, run 'nix log /nix/store/sfw05l85h9silyhgypishjsx6z7z2rnc-firefox-devedition-bin-85.0b6.drv'.
error: 1 dependencies of derivation '/nix/store/i531v3ys0v3rfa1k822mvkxk76sxn8b4-firefox-devedition-bin-85.0b6-fish-completions.drv' failed to build
error: 1 dependencies of derivation '/nix/store/i5prr76li2mnhcnk5bv1xnipci6q7pil-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/pgfs8f93w1zsd3n9i5n7h36gd4xhli2q-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/qq97xkvbrh4r13nrp62p7razhd6zqs9n-user-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mfgzc92r5vsgqq01fmd5xpdmm6ykhsbb-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/qyh338lg8a4fqbv7xznyrpkznhkn673v-nixos-system-nixos-21.05.20210516.f2c015d.drv' failed to build
error: getting status of '/tmp/nixos-rebuild.SJbB7r/result': No such file or directory

Note that the directory has an executable

$ ls /nix/store/r5c5mj2z8h8k744jzpycxmzqsabq232n-firefox-devedition-bin-85.0b6/bin/
firefox-devedition

but it doesn't end on -bin

Technical details

this path will be fetched (0.00 MiB download, 0.00 MiB unpacked):
  /nix/store/ffx6n6sf3fblya7vpp38xys6wn8qbhii-nix-info
copying path '/nix/store/ffx6n6sf3fblya7vpp38xys6wn8qbhii-nix-info' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 5.11.21, NixOS, 21.05.20210516.f2c015d (Okapi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.4pre20210503_6d2553a`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
berbiche commented 3 years ago

Hum, looks like the change in 7d765d8f46b479abe69b6da324e6bb6444be5cfd https://github.com/nix-community/home-manager/blob/7d765d8f46b479abe69b6da324e6bb6444be5cfd/modules/programs/firefox.nix#L285

should have been: cfg.package.override (old: old // { cfg = old.cfg or {} // fcfg; })

cc @ambroisie

edit: this is the only thing that could affect this I believe.

I recall the definition of the different Firefox versions pass other information in the top-level arguments, the override must have removed these definitions.

ambroisie commented 3 years ago

That is probably it, yes.

cideM commented 3 years ago

I won't have access to my NixOS desktop for another week so I can't create a PR right now :(

teto commented 3 years ago

would need a test too then

ambroisie commented 3 years ago

I tried reverting the commit and using the same configuration as @cideM. I still get the same error. It seems the error is coming from elsewhere.

justinlovinger commented 3 years ago

I'm also having this issue with programs.firefox.package = pkgs.firefox-wayland, but my logs show:

building '/nix/store/qixpd9d5sz66qzb4svp02mrhplxn04ba-firefox-88.0.1.drv'...
WARNING: Couldn't set ownership of text file bin/.firefox-old
/nix/store/lgp6bl9sjqd7frsr6szcq82b51ayp9y1-stdenv-linux/setup: line 1387: /nix/store/c1yccvay5ww293036pri6jl6bv0h9kwz-firefox-88.0.1/nix-support/propagated-user-env-packages: Permission denied
builder for '/nix/store/qixpd9d5sz66qzb4svp02mrhplxn04ba-firefox-88.0.1.drv' failed with exit code 1
sigprof commented 3 years ago

WARNING: Couldn't set ownership of text file bin/.firefox-old /nix/store/lgp6bl9sjqd7frsr6szcq82b51ayp9y1-stdenv-linux/setup: line 1387: /nix/store/c1yccvay5ww293036pri6jl6bv0h9kwz-firefox-88.0.1/nix-support/propagated-user-env-packages: Permission denied

@JustinLovinger You apparently have a different issue — I got the same error because my Home Manager config did hot have home.stateVersion = "21.05" (or another value not less than 19.09), so the state version defaulted to 18.09, and in this case program.firefox.package is expected to be an unwrapped Firefox package. If you also have the same situation, you may need to change some other settings when you add home.stateVersion.

The reason why I did not have home.stateVersion is that I installed Home Manager as a NixOS module, and therefore did not get an initial configuration file from the installation process, as suggested for a standalone installation.

justinlovinger commented 3 years ago

@sigprof That appeared to fix it for me. Curiously, Home Manager didn't seem to mind a wrapped Firefox package before 21.05 .

miangraham commented 3 years ago

One more voice chiming in to say that on nixos as of 20.09 I was setting home.firefox.package with no explicit home.stateVersion and having no issues. Upgrading to 21.05 gave me the propagated-user-env-packages: Permission denied breakage for the first time, and setting home.stateVersion = "21.05" fixed me.

berbiche commented 3 years ago

Seems like the solution is to set home.stateVersion to something above 20.09.

Closing this. Feel free to reopen.