-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fish: Fix regression due to changes in nixpkgs. #1703
Conversation
modules/programs/fish.nix
Outdated
@@ -343,7 +343,7 @@ in { | |||
# if we haven't sourced the general config, do it | |||
if not set -q __fish_general_config_sourced | |||
|
|||
set -p fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions | |||
set --prepend fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this break users not tracking the latest unstable?
If so, how about using pkgs.fish-foreign-env or pkgs.fishPlugins.foreign-env
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it would need to be if pkgs ? fish-foreign-env then "${pkgs.fish-foreign-env}/share/fish-foreign-env/functions" else "${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d"
, since the directory providing the function changed as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkgs.fish-foreign-env
still exists (NixOS/nixpkgs@d94921d#diff-29ed0f5fda84c91253503c1664d60a194a324e29518d472adf846f30b8db52e3R161), so branching by pkgs ? fish-foreign-env
seems not to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then:
set --prepend fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d | |
set --prepend fish_function_path ${if pkgs ? fishPlugins && pkgs.fishPlugins ? foreign-env then "${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d" else "${pkgs.fish-foreign-env}/share/fish-foreign-env/functions"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did anybody try the diff proposed by @cole-h? If it works then we can include it but otherwise I think it should be OK to merge as-is since I think it is reasonable to assume that HM follows Nixpkgs master as closely as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll report on it later today. I agree simply tracking master is ok but if it's this simple to keep backwards compatibility, maybe it's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wanted to try this out but I realized there's no home.imports
or similar which is how I replace nixos modules. What's the most straightforward way for me to test this patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can set programs.home-manager.path = ~/path/to/cloned/home-manager
and apply the modification locally.
This won't work when using flake (I think).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to rycee's help I can now confirm that cole-h's suggestion works. The h-m manual makes a point of mentioning backward-compatibility for modules in this case the price for that is a branch : )
Force-pushed commit with updated commit message. I can't judge if this is mergeable or not. |
It's mergeable if we don't mind breaking users who don't update nix{os,pkgs}-unstable and h-m unstable in lockstep. |
Isn't the current situation broken for anyone who tracks nixpkgs-unstable close enough, regardless of how often they update h-m? |
I think so, the issue is someone updating HM without updating nixpkgs... |
It's not clear to me why this would be backwards-incompatible for users who don't update channels in lock-step, could someone explain the problem? @cole-h's test covers the case where h-m is updated but nixpkgs isn't, doesn't it? |
Thanks all! Merged to master with @cole-h's proposed change included. |
It has been a while since the last update. This includes some new features [1] and at least one compatibility fix [2]. [1] https://github.com/nix-community/home-manager/blob/73506f947c3a2f63306233358231b069865d1d56/modules/misc/news.nix#L1653 [2] nix-community/home-manager#1703
Description
Fix for changes in nixpkgs fish plugin organisation on unstable:
NixOS/nixpkgs@d94921d
fixes #1701 #1702
Checklist
Change is backwards compatible.
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
.Test cases updated/added. See example.
Commit messages are formatted like