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
nixos/weechat: backport to 18.09 #46861
Conversation
This aims to make the `weechat` package even more configurable. It allows to specify scripts and commands using the `configure` function inside a `weechat.override` expression. The package can be configured like this: ``` with import <nixpkgs> { }; weechat.override { plugins = { availablePlugins, ... }: { plugins = builtins.attrValues availablePlugins; init = '' /set foo bar /server add freenode chat.freenode.org ''; scripts = [ "/path/to/script.py" ]; }; } ``` All commands are passed to `weechat --run-command "/set foo bar;/server ..."`. The `plugins' attribute is not necessarily required anymore, if it's sufficient to add `init' commands, the `plugins' will be `builtins.attrValues availablePlugins' by default. Additionally the result contains `weechat` and `weechat-headless` (introduced in WeeChat 2.1) now.
This adds several improvements the previously introduced `services.weechat` module: * Dropped `services.weechat.init` as the initialization script can now be done on package-level since 2af41719bc using the `configure` function. * Added `sessionName` option to explicitly configure a name for the `screen` session (by default: weechat-screen). * Added `binary` option to configure the binary name (e.g. `weechat-headless`). * Added docs regarding `screen` session and `weechat.service`.
In my previous PR I missed that ${sec.foobar} (syntax to retrieve secrets in a weechat runtime) breaks the shell evaluation. Furthermore `;` shall be used rather than `\n` to concat scripts and the init config.
Loading olm.lua as weechat script with `/script load olm.lua' causes errors like this: ``` /nix/store/43jbh7yxh8j4gjfzbvpd9clncah5dip1-weechat-matrix-bridge-2018-05-29/lib/ffi.so: undefined symbol: lua_tointeger ``` As `olm.lua' is loaded by `matrix.lua' it doesn't need to be included manually by the weechat configuration.
Success on x86_64-linux (full log) Attempted: weechat Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: weechat Partial log (click to expand)
|
If this gets into 18.09, #47164 is also needed in order to fix package metadata. |
Currently the output from `nix search` and similar tools are lacking important meta data
@srhb thanks, fixed:) |
Success on x86_64-linux (full log) Attempted: weechat Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: weechat Partial log (click to expand)
|
Hmm, sorry to ask so much, but could you No need to add an additional reason to the messages, here it's just for bookkeeping. |
Close #46861 - it's exactly the same commits, just with -x annotations.
Done as 317ce1b. |
Motivation for this change
This backports my weechat enhancements to 18.09. It allows users to declaratively specify scripts and configuration in
weechat.override
. Additionally adds a module which runs weechat in ascreen
session which is useful when running weechat on a different server for IRC persistence.I'm using these changes on top of
release-18.09
since original the PR was merged. This PR adds a new module and doesn't break current weechat package configurations. Please refer to #45728 for the initial discussion regarding the changes and the backport./cc @samueldr
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)