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

programs.fish broken on nixpkgs unstable #1702

Closed
meck opened this issue Jan 7, 2021 · 5 comments
Closed

programs.fish broken on nixpkgs unstable #1702

meck opened this issue Jan 7, 2021 · 5 comments

Comments

@meck
Copy link
Contributor

meck commented Jan 7, 2021

Issue description

Changes is nixpkgs fish-foreign-env brakes programs.fish sourcing of home manager.

Meta

Maintainer CC

@rycee

Technical details

When lauching a shell with programs.fish enabled on unstable nixpkgs

~/.config/fish/config.fish (line 8):
  fenv source /home/meck/.nix-profile/etc/profile.d/hm-session-vars.sh > /dev/null
  ^
from sourcing file ~/.config/fish/config.fish
        called during startup

NixOS/nixpkgs@d94921d seems to be responsible.

Changing:

set -p fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions

to the version currently in the nixpkgs fish module seems to fix the problem:

 set --prepend fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d
@meck
Copy link
Contributor Author

meck commented Jan 7, 2021

#1701 Is the same issue.

rycee pushed a commit to meck/home-manager that referenced this issue Jan 7, 2021
rycee pushed a commit that referenced this issue Jan 9, 2021
@rycee rycee closed this as completed in e835812 Jan 9, 2021
pacien added a commit to pacien/nixpkgs that referenced this issue Jan 10, 2021
The fish-foreign-env and the fishPlugins.foreign-env packages aren't
compatible due to changes in directory layout.

It's better to remove the alias so that the evaluation explicitly fails
instead of allowing silent runtime breakage.

GitHub: see NixOS#107834 (comment)
GitHub: see LnL7/nix-darwin#269
GitHub: see nix-community/home-manager#1701
GitHub: see nix-community/home-manager#1702
@wbadart
Copy link

wbadart commented Jan 17, 2021

Hey all- today I bumped into a possibly related issue building my config from nixpkgs unstable (I have home-manager installed as a nixos module, in case that's important):

$ sudo nixos-rebuild switch --upgrade
unpacking channels...
building Nix...
building the system configuration...
error: fish-foreign-env has been replaced with fishPlugins.foreign-env
(use '--show-trace' to show detailed location information)
Here's the whole trace:
$ sudo nixos-rebuild switch --upgrade --show-trace
unpacking channels...
building Nix...
building the system configuration...
error: while evaluating the attribute 'activationScript' of the derivation 'nixos-system-wb-machine-21.03pre263749.b3616bd9640' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix:95:5:
while evaluating the attribute 'system.activationScripts.script' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:80:9:
while evaluating 'textClosureMap' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/strings-with-deps.nix:75:35, called from /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:101:18:
while evaluating 'id' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/trivial.nix:14:5, called from undefined position:
while evaluating the attribute 'text' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:9:5:
while evaluating the attribute 'text' at undefined position:
while evaluating 'g' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:276:19, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:139:72, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:279:20:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:512:9:
while evaluating the option `system.activationScripts.etc.text':
while evaluating the attribute 'mergedValue' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:544:5:
while evaluating the attribute 'values' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:538:9:
while evaluating the attribute 'values' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:637:7:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:524:28, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:524:17:
while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix':
while evaluating 'dischargeProperties' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:596:25, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:525:137:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:379:44:
while evaluating the attribute 'sources' of the derivation 'etc' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix:12:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix:20:20, called from undefined position:
while evaluating the attribute 'source' at undefined position:
while evaluating 'g' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:276:19, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:139:72, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:279:20:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:512:9:
while evaluating the option `environment.etc.systemd/system.source':
while evaluating the attribute 'mergedValue' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:544:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:546:17, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:546:12:
while evaluating 'check' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:345:15, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:546:22:
while evaluating the attribute 'buildCommand' of the derivation 'system-units' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating the attribute 'text' of the derivation 'unit-home-manager-will.service' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating the attribute 'text' at undefined position:
while evaluating 'g' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:276:19, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:139:72, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:279:20:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:512:9:
while evaluating the option `systemd.units.home-manager-will.service.text':
while evaluating the attribute 'mergedValue' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:544:5:
while evaluating the attribute 'values' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:538:9:
while evaluating the attribute 'values' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:637:7:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:524:28, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:524:17:
while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd.nix':
while evaluating 'dischargeProperties' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:596:25, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:525:137:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:379:44:
while evaluating 'attrsToSection' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd-lib.nix:109:20, called from /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd.nix:344:13:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd-lib.nix:111:12, called from undefined position:
while evaluating 'toOption' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd-lib.nix:104:14, called from /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd-lib.nix:112:21:
while evaluating the attribute 'text' of the derivation 'activate-will' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating the attribute 'buildCommand' of the derivation 'home-manager-generation' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating the attribute 'buildCommand' of the derivation 'home-manager-files' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating anonymous function at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/attrsets.nix:234:10, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/home-manager/modules/files.nix:318:28, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/attrsets.nix:234:16:
while evaluating 'concatMapStringsSep' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/strings.nix:110:5, called from /nix/var/nix/profiles/per-user/root/channels/home-manager/modules/files.nix:320:13:
while evaluating 'escapeShellArg' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/strings.nix:318:20, called from undefined position:
while evaluating 'sourceStorePath' at /nix/var/nix/profiles/per-user/root/channels/home-manager/modules/files.nix:15:21, called from /nix/var/nix/profiles/per-user/root/channels/home-manager/modules/files.nix:321:16:
while evaluating the attribute 'source' at undefined position:
while evaluating 'g' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/attrsets.nix:276:19, called from undefined position:
while evaluating anonymous function at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:139:72, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/attrsets.nix:279:20:
while evaluating the attribute 'value' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:512:9:
while evaluating the option `home-manager.users.will.home.file./home/will/.config/fish/config.fish.source':
while evaluating the attribute 'mergedValue' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:544:5:
while evaluating the attribute 'values' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:538:9:
while evaluating the attribute 'values' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:637:7:
while evaluating anonymous function at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:524:28, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:524:17:
while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/home-manager/modules/files.nix':
while evaluating 'dischargeProperties' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:596:25, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:525:137:
while evaluating the attribute 'condition' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:680:14:
while evaluating the attribute 'text' at undefined position:
while evaluating 'g' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/attrsets.nix:276:19, called from undefined position:
while evaluating anonymous function at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:139:72, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/attrsets.nix:279:20:
while evaluating the attribute 'value' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:512:9:
while evaluating the option `home-manager.users.will.home.file./home/will/.config/fish/config.fish.text':
while evaluating the attribute 'mergedValue' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:544:5:
while evaluating the attribute 'values' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:538:9:
while evaluating the attribute 'values' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:637:7:
while evaluating anonymous function at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:524:28, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:524:17:
while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/home-manager/modules/misc/xdg.nix':
while evaluating 'dischargeProperties' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:596:25, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:525:137:
while evaluating the attribute 'value' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:379:44:
while evaluating 'g' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/attrsets.nix:276:19, called from undefined position:
while evaluating anonymous function at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:139:72, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/attrsets.nix:279:20:
while evaluating the attribute 'value' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:512:9:
while evaluating the option `home-manager.users.will.xdg.configFile.fish/config.fish.text':
while evaluating the attribute 'mergedValue' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:544:5:
while evaluating the attribute 'values' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:538:9:
while evaluating the attribute 'values' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:637:7:
while evaluating anonymous function at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:524:28, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:524:17:
while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/home-manager/modules/programs/fish.nix':
while evaluating 'dischargeProperties' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:596:25, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:525:137:
while evaluating the attribute 'value' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/modules.nix:379:44:
while evaluating the attribute 'fish-foreign-env' at undefined position:
while evaluating anonymous function at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/top-level/aliases.nix:27:22, called from undefined position:
while evaluating 'removeDistribute' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/top-level/aliases.nix:15:22, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/top-level/aliases.nix:27:29:
while evaluating 'isDerivation' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/lib/attrsets.nix:305:18, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/top-level/aliases.nix:16:8:
while evaluating 'removeRecurseForDerivations' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/top-level/aliases.nix:8:33, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/top-level/aliases.nix:28:31:
while evaluating 'checkInPkgs' at /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/top-level/aliases.nix:22:20, called from /nix/store/blmndg4cklipkc94l8gb2q76yiia4l0j-nixos-21.03pre263749.b3616bd9640/nixos/pkgs/top-level/aliases.nix:29:32:
fish-foreign-env has been replaced with fishPlugins.foreign-env

Any thoughts?

@gvolpe
Copy link
Contributor

gvolpe commented Jan 17, 2021

I ran into the same issue, even after upgrading to the latest nixpkgs on the unstable channel a few hours ago.

$ nixos-version
21.03pre263749.b3616bd9640 (Okapi)

$ nix-channel --list
home-manager https://github.com/rycee/home-manager/archive/master.tar.gz

I tried adding pkgs.fishPlugins.foreign-env to home.packages as well as programs.fish.plugins = [ pkgs.fishPlugins.foreign-env ]; in a desperate attempt to fix this but no luck so far.

Any pointers on how to fix this much appreciated.

@Xe
Copy link

Xe commented Jan 20, 2021

I fixed this by adding this to my packageOverrides:

  fish-foreign-env = pkgs.fishPlugins.foreign-env;

@NickHu
Copy link
Collaborator

NickHu commented Jan 20, 2021

I fixed this by adding this to my packageOverrides:

  fish-foreign-env = pkgs.fishPlugins.foreign-env;

This is not a fix. See NixOS/nixpkgs#108897.

The fish-foreign-env and the fishPlugins.foreign-env packages aren't
compatible due to changes in directory layout.

malte-v pushed a commit to malte-v/home-manager that referenced this issue Feb 24, 2021
aakropotkin pushed a commit to aakropotkin/home-manager that referenced this issue Feb 28, 2021
cab404 pushed a commit to cab404/home-manager that referenced this issue Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants