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

tmuxPlugins: expose mkDerivation for creating a TMUX plugins #44560

Merged
merged 1 commit into from Aug 7, 2018

Conversation

kalbasit
Copy link
Member

@kalbasit kalbasit commented Aug 6, 2018

Motivation for this change

Expose buildTmuxPlugin so users can use it in their overlays.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

$ nix repl .
Welcome to Nix version 2.0.4. Type :? for help.
Loading '.'...
Added 9270 variables.
nix-repl> p = tmuxPlugins.fzf-tmux-url
nix-repl> p.rtp
"/nix/store/k3v0vvfkw9kkirf0k5gdiz8kqvrj8i3i-tmuxplugin-fzf-tmux-url/share/tmux-plugins/fzf-tmux-url/fzf-url.tmux"
nix-repl> tmuxPlugins.mkDerivation
«lambda @ /code/opensource/stories/nixpkgs-export-buildtmuxplugin/src/github.com/NixOS/nixpkgs/pkgs/misc/tmux-plugins/default.nix:50:18»
nix-repl> p = tmuxPlugins.mkDerivation {pluginName = "better-mouse-mode"; rtpFilePath = "scroll_copy_mode.tmux"; src = fetchgit { url = "https://github.com/NHDaly/tmux-better-mouse-mode"; rev = "aa59077c635ab21b251bd8cb4dc24c415e64a58e"; sha256 = "06346ih3hzwszhkj25g4xv5av7292s6sdbrdpx39p0n3kgf5mwww"; }; }
nix-repl> p.rtp
"/nix/store/xc09w6w3lj52fbcpjhs61q0dwyxki5i9-tmuxplugin-better-mouse-mode/share/tmux-plugins/better-mouse-mode/scroll_copy_mode.tmux"

@kalbasit kalbasit changed the title tmux-plugin: expose buildTmuxPlugin [WIP] tmux-plugin: expose buildTmuxPlugin Aug 6, 2018
@kalbasit kalbasit force-pushed the nixpkgs-export-buildtmuxplugin branch from babd6d6 to a7726a7 Compare August 6, 2018 18:46
@kalbasit kalbasit changed the title [WIP] tmux-plugin: expose buildTmuxPlugin top-level: expose buildTmuxPlugin Aug 6, 2018
@infinisil
Copy link
Member

I think an easier and better solution is to just expose that function in pkgs/misc/tmux-plugins/default.nix, such that people can build their plugins via pkgs.tmuxPlugins.buildTmuxPlugin or maybe better yet, mkDerivation instead of buildTmuxPlugin, as it's done with Haskell (better because pkgs.tmuxPlugins.buildTmuxPlugin is a bit redundant, and as a convention).

@kalbasit kalbasit force-pushed the nixpkgs-export-buildtmuxplugin branch from a7726a7 to 4553816 Compare August 6, 2018 19:09
@kalbasit kalbasit changed the title top-level: expose buildTmuxPlugin tmuxPlugins: expose mkDerivation for creating a TMUX plugins Aug 6, 2018

in rec {

battery = buildTmuxPluginFrom2Nix {
mkDerivation = a: (buildTmuxPlugin a);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly the same as mkDerivation = buildTmuxPlugin because of currying. This means you can just declare mkDerivation above directly, then inherit mkDerivation; here. Or declaring mkDerivation here would work as well (because it's in a rec).

@kalbasit
Copy link
Member Author

kalbasit commented Aug 6, 2018

@infinisil it's done, PTAL.

@kalbasit kalbasit force-pushed the nixpkgs-export-buildtmuxplugin branch from 4553816 to e8a5f6c Compare August 6, 2018 19:17
Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to me, but I'd like @pjan to have a look at this as well

@fpletz fpletz merged commit 0099110 into NixOS:master Aug 7, 2018
@kalbasit kalbasit deleted the nixpkgs-export-buildtmuxplugin branch August 7, 2018 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants