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
oh-my-zsh: undefine functions that don't work on Nix #92950
Conversation
001043b
to
baa4cae
Compare
chmod -R +w lib | ||
|
||
# Remove functions that don't work on Nix | ||
sed -i -e "/uninstall_oh_my_zsh()/,/}/ 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.
This will probably break as soon as this function has a }
(in a future version) leaving a broken file in $out
. I'd really prefer to apply a patch here.
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.
It might be better to add
unfunction uninstall_oh_my_zsh
unfunction upgrade_oh_my_zsh
to $template, that way we wouldn't need to update a patch file after changes to the function are made and it is a simpler addition than adding a patch file.
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.
This is probably the best way to go about it, since patching the sources is inherently fragile. You should be able to add those two lines just after cat >> $template <<- EOF
.
I didn't know unfunction
even existed, that's a cool name 🙂
Both functions expect oh-my-zsh to be in ~/.oh-my-zsh and try to modify the directory. This doesn't work, since it is in the Nix store.
baa4cae
to
153367b
Compare
Instead of appending the commands to $template, this updated commit appends them to oh-my-zsh.sh, because:
|
@samuelgrf I don't know any more what the various files in Oh My Zsh do, but your approach looks good. |
Both functions expect oh-my-zsh to be in ~/.oh-my-zsh and try to
modify the directory. This doesn't work, since it is in the
Nix store.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)