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

weechat-matrix-bridge: init at 2017-03-28 #28738

Merged
merged 2 commits into from
Aug 31, 2017

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Aug 30, 2017

Motivation for this change

Contains a packaged version of the LUA script which connects weechat with a matrix server.

I'm currently using it locally and it works fine, however it would be cool if more people could test it :-)

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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/)
  • Fits CONTRIBUTING.md.

@Ma27 Ma27 force-pushed the init/weechat-matrix-bridge branch from 2dfe9c4 to 452318e Compare August 30, 2017 09:17
@fpletz
Copy link
Member

fpletz commented Aug 30, 2017

What is the process to load this module into weechat?

@Ma27
Copy link
Member Author

Ma27 commented Aug 30, 2017

I opened this PR because I always try to contribute the Nix expressions I built back to the ecosystem if possible.
My current approach is unfortunately quite crappy (simple nix-build --out-link), however I wanted to try building something based on a FHS environment as it's possible to modify the home dir of weechat (default to ~/.weechat) which contains the plugins, but needs to be writable.

If I manage to build something usable, I'll submit another PR :-)

@Ma27
Copy link
Member Author

Ma27 commented Aug 30, 2017

btw the travis error seems quite unrelated. I shouldupdate my local nixpkgs, however this might delay until I have better wifi :p

+package.cpath = package.cpath .. ";__NIX_LIB_PATH__"
+
local json = require 'cjson' -- apt-get install lua-cjson
local olmstatus, olm = pcall(require, 'olm') -- LuaJIT olm FFI binding ln -s ~/olm/olm.lua /usr/local/share/lua/5.1
Copy link
Member

Choose a reason for hiding this comment

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

Does not this also require libolm?

Copy link
Member Author

Choose a reason for hiding this comment

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

good point, my current (testing) setup works without olm ATM.
Will update the expression as soon as I got time to :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@Ma27
Copy link
Member Author

Ma27 commented Aug 30, 2017

@fpletz I created the following gist which contains the expression I'm currently using: https://gist.github.com/Ma27/153a2bd1089c284671d0018508c9c66e

Would appreciate it if we could discuss about it, when we found a suitable solution for nixpkgs, I'll submit a PR :-)

@Ma27 Ma27 force-pushed the init/weechat-matrix-bridge branch 2 times, most recently from faf03b3 to 7431641 Compare August 31, 2017 09:52
@Ma27 Ma27 force-pushed the init/weechat-matrix-bridge branch from 7431641 to 724a69f Compare August 31, 2017 09:57
@Mic92 Mic92 merged commit feea019 into NixOS:master Aug 31, 2017
@Mic92
Copy link
Member

Mic92 commented Aug 31, 2017

Thanks!

@Ma27 Ma27 deleted the init/weechat-matrix-bridge branch August 31, 2017 14:09
@Ma27 Ma27 mentioned this pull request Sep 2, 2017
8 tasks
@jluttine
Copy link
Member

jluttine commented Nov 4, 2017

@Ma27 This is really interesting! Do you think this is or could be compatible with this WeeChat plugin system pull request: #25274 ? It would be nice to be able to load these plugins easily in WeeChat.

@Ma27
Copy link
Member Author

Ma27 commented Nov 4, 2017

@jluttine didn't have a deeper look into it, but yeah, I've planned to give it a try as soon as #25274 is merged.

@timokau
Copy link
Member

timokau commented Aug 25, 2018

@Ma27 I see that #25274 is merged now. Is there some way to build weechat with this plugin included?

@Ma27
Copy link
Member Author

Ma27 commented Aug 27, 2018

Unfortunately not with this patch directly.

There's a difference between plugins and scripts in weechat and since weechat/weechat#971 it's now possible to search for plugins at multiple locations, e.g. ~/.weechat and a store path which bundles several plugins.
I currently work around this with a module that links everything into a single directory (https://gitlab.com/Ma27/nur-packages/blob/master/modules/weechat.nix#L95), however it's definetely a better solution to patch weechat accordingly (which I still have to at some time)

@timokau
Copy link
Member

timokau commented Aug 27, 2018

You might want to use symlinkJoin for that. Otherwise I don't think the solution is inherently bad. Its pretty much the same thing python does. Any reason you haven't upstreamed those changes yet? They should even be backwards compatible if you do get around to make the change in weechat right?

@Ma27
Copy link
Member Author

Ma27 commented Aug 27, 2018

You might want to use symlinkJoin for that

Care to elaborate? Weechat stores all of its data (except plugins since #25274) in ~/.weechat which is writable and can't be a store path.
If you reference to my (admittedly hacky) module, I didn't do this to keep the directories writable. When I add a simple script to test it, I don't want to have a readonly store path, but a writable directory with linked scripts (at least for now).

Any reason you haven't upstreamed those changes yet?

When I started working on this, it was just some crazy late-night experiment that was far too opinionated. It became a bit more usable for normal people, but I'm still not sufficiently confident to submit it to nixpkgs upstream, since I still dislike the manual configuration of files like irc.conf or weechat.conf. Many scripts store their defaults in such files, having them read-only makes the setup significantly harder.

Furthermore I'm not sure if this is the way to go. In fact, there's #33523 which also uses screen to allow weechat running on a different machine and access it via ssh.
It allows to configure using /cmd foobar through Nix (didn't know how to implement this some months ago 😅 ), however this is the better solution IMHO.
Regarding the scripts I'd prefer to implement a better resolution approach upstream which allows multiple directories to search for scripts, then we may have an even better approach for a declarative weechat configuration.

Until then I'd use my weechat module, but I'd much rather reserve some time in the next months to implement it right for upstream :)

@timokau
Copy link
Member

timokau commented Aug 27, 2018 via email

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

Successfully merging this pull request may close these issues.

None yet

5 participants