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

nixos/weechat: add module #45728

Merged
merged 4 commits into from Sep 7, 2018
Merged

nixos/weechat: add module #45728

merged 4 commits into from Sep 7, 2018

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Aug 29, 2018

Motivation for this change

Follow-up for #33523. Removed static uid/gid as proposed here (#33523 (comment)) and added support for loading custom scripts.

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.

@Ma27
Copy link
Member Author

Ma27 commented Aug 29, 2018

@timokau after yesterday's discussion I was motivated to have a look at it. Seems as it's sufficient to load scripts by specifying their absolute paths (means, store paths :D). Would be cool if you could have a look at this.

@yegortimoshenko as I wanted to hack on a weechat module for NixOS I used your PR from January as base. It would be awesome if you could have a look at this! :)

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: weechat

Partial log (click to expand)

copying path '/nix/store/zy4228z6ya2b8k95kfiyb44n96k5r3gq-guile-2.0.13' from 'https://cache.nixos.org'...
copying path '/nix/store/p4pwl0qb7g5h5zg2nqawki8grizl4plf-lua-5.2.3' from 'https://cache.nixos.org'...
copying path '/nix/store/54w9xzm9jrx9xk5bh11033hl4yikkldq-tcl-8.6.6' from 'https://cache.nixos.org'...
copying path '/nix/store/6gmslna2s5ig360raxcpcza289v1bbn0-weechat-2.1-lua' from 'https://cache.nixos.org'...
copying path '/nix/store/rz4zbcdwyd3rg366w48w5g6r24kf0lbd-weechat-2.1' from 'https://cache.nixos.org'...
copying path '/nix/store/wfycvzamj8wyccc4kis0airlhdl71xzs-weechat-2.1-tcl' from 'https://cache.nixos.org'...
copying path '/nix/store/qr8py347wqkmf9r0phq7ixmpflzgrf7n-weechat-2.1-guile' from 'https://cache.nixos.org'...
copying path '/nix/store/nv0006xh0chz5y0fv7ggim5yra1bkqb2-weechat-plugins' from 'https://cache.nixos.org'...
building '/nix/store/gz0158jcb98mxwn251fpvbh5y7h9dwp9-weechat.drv'...
/nix/store/32phnn0rbgfwj8plhzfg0fjhvham4p7w-weechat

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: weechat

Partial log (click to expand)

copying path '/nix/store/xkzj19d9rlapr9d6kf8igw8303qp2wfp-ruby-2.4.4' from 'https://cache.nixos.org'...
copying path '/nix/store/0r8kszrm1kkimdksn85vfbk7cazacpzq-weechat-2.1-guile' from 'https://cache.nixos.org'...
copying path '/nix/store/18p3klp6m1wvf386rxxn81dy9qkvy94q-weechat-2.1-lua' from 'https://cache.nixos.org'...
copying path '/nix/store/jp7r4n062yh20v6gr6m924l57n6grjcm-weechat-2.1-perl' from 'https://cache.nixos.org'...
copying path '/nix/store/bac623nwawy37l1yndq8iqns7a98gffj-weechat-2.1-python' from 'https://cache.nixos.org'...
copying path '/nix/store/silpcbg8k5bghgilrdvdvw21kvfzzmbz-weechat-2.1-ruby' from 'https://cache.nixos.org'...
copying path '/nix/store/hkx1zhx72xxm33313lb7ars4f58ghkrj-weechat-2.1-tcl' from 'https://cache.nixos.org'...
copying path '/nix/store/bvxka67lyagz9igy22m8mi3mpj5n3rq9-weechat-plugins' from 'https://cache.nixos.org'...
building '/nix/store/vhcbc7za2lbkmclwvrdgprl8qdarcg4w-weechat.drv'...
/nix/store/iq75mvwy26qf28lhax19867h4i951nym-weechat

options = {
name = mkOption {
type = str;
description = "Path to the script in the derivation.";
Copy link
Member

Choose a reason for hiding this comment

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

So name is actually a path?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking about "name of the script", but well, there are only two hard things in computer science, right? ;)

But seriously, you're right, path is much better, however this can be dropped as you stated later on.

default = [];
example = literalExample ''
[
{ name = "share/jabber.py"; script = pkgs.weechat-xmpp }
Copy link
Member

Choose a reason for hiding this comment

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

Why not just "${pkgs.weechat-xmpp}/share/jabber.py"? Or maybe even force the script packages to be in a standard format and only require the package.

Copy link
Member Author

Choose a reason for hiding this comment

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

you're absolutely right! I originally wanted to define a pre-defined output structure for derivations which feature weechat scripts, but dropped the idea later and kept the (admittedly too complex submodule type).

'';
};
sessionName = mkOption {
description = "Name of the `screen' session for weechat.";
Copy link
Member

Choose a reason for hiding this comment

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

I think it is better to use normal quotes here. I don't think the tex-like backtick/normal tick combination is very common in plain text.

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure though. I've seen this fairly often in the Nix(OS) context including descriptions for options and wanted to be convenient. But feel free to correct me, I'm not sure about this :)

Copy link
Member

Choose a reason for hiding this comment

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

You're right, I can find a couple of examples of both simple quotes and ' quotes in man configuration.nix`. I personally prefer simple quotes but since there is apparently no consensus I'm fine with whatever you prefer.

wantedBy = [ "multi-user.target" ];
};

services.weechat.init = mkIf (builtins.length cfg.scripts != 0) (concatStringsSep "\n"
Copy link
Member

Choose a reason for hiding this comment

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

Is this mkif really necessary? Wouldn't it just be an empty string in the case of length 0?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're absolutely right, this makes the expression way easier to read, thanks!

};

services.weechat.init = mkIf (builtins.length cfg.scripts != 0) (concatStringsSep "\n"
(map (script: "/script load ${script.script}/${script.name}\n") cfg.scripts));
Copy link
Member

Choose a reason for hiding this comment

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

I don't have very much experience with the module system and merging and everything -- will these scripts be loaded before the rest of the init code is executed? I think they should be.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure either, but you're right, it to avoid breaking scripts it might be helpful to use mkBefore to be absolutely sure :)

systemd.services.weechat-apply-init = let
initFile = pkgs.writeText "weechat-init" cfg.init;
in {
script = "sed 's/^/*/' ${initFile} > ${cfg.root}/weechat_fifo";
Copy link
Member

Choose a reason for hiding this comment

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

What does this do?

Copy link
Member Author

Choose a reason for hiding this comment

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

according to the docs (https://weechat.org/files/doc/stable/weechat_user.en.html#fifo_plugin), the * at the beginning of a string is needed when passing commands to weechat through weechat_fifo. This was actually introduced in the previous commit I didn't author, but it's more convenient to type /cmd args... without the star at the beginning.

Copy link
Member

Choose a reason for hiding this comment

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

Oh so the sed script is replacing the nothing at the beginning of each line with a literal *. I thought that was some kind of special syntax or something. We could do the same with the /, I'm unsure about that though. Should be fine either way as long as the expected format is documented.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just used the code from the previous commit. However I think that this is the right way to go as the star is only used with fifo.
However the / at the beginning is also used when running weechat from an active session, so it's IMHO more convenient to keep this.

@timokau
Copy link
Member

timokau commented Aug 29, 2018

Thanks! Any reason you went with a nixos module? I feel like adding the configuration through a package wrapper may be nicer.

@Ma27
Copy link
Member Author

Ma27 commented Aug 29, 2018

Any reason you went with a nixos module? I feel like adding the configuration through a package wrapper may be nicer.

I originally wanted to make the weechat module of @yegortimoshenko ready to merge and wanted to see if it's possible to easily add support for scripts (which is easily doable by adding /script load $path to services.weechat.init). Previously I assumed that scripts are only loadable if they're installed in ~/.weechat, however absolute paths are possible as well.

I'm not sure if we want to duplicate the weechat_fifo the logic of the previously written module in the package (and if it's even possible), but I'm happy to discuss about it to see which is the best decision for nixpkgs :)

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: weechat

Partial log (click to expand)

copying path '/nix/store/zy4228z6ya2b8k95kfiyb44n96k5r3gq-guile-2.0.13' from 'https://cache.nixos.org'...
copying path '/nix/store/6gmslna2s5ig360raxcpcza289v1bbn0-weechat-2.1-lua' from 'https://cache.nixos.org'...
copying path '/nix/store/rz4zbcdwyd3rg366w48w5g6r24kf0lbd-weechat-2.1' from 'https://cache.nixos.org'...
copying path '/nix/store/wfycvzamj8wyccc4kis0airlhdl71xzs-weechat-2.1-tcl' from 'https://cache.nixos.org'...
copying path '/nix/store/qr8py347wqkmf9r0phq7ixmpflzgrf7n-weechat-2.1-guile' from 'https://cache.nixos.org'...
copying path '/nix/store/wky3nf0x34sm90rknmwmn4w54s7j1yrh-ruby-2.4.4' from 'https://cache.nixos.org'...
copying path '/nix/store/lsc8jygwas35d3sll95brv4vy2p81nwg-weechat-2.1-ruby' from 'https://cache.nixos.org'...
copying path '/nix/store/nv0006xh0chz5y0fv7ggim5yra1bkqb2-weechat-plugins' from 'https://cache.nixos.org'...
building '/nix/store/gz0158jcb98mxwn251fpvbh5y7h9dwp9-weechat.drv'...
/nix/store/32phnn0rbgfwj8plhzfg0fjhvham4p7w-weechat

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: weechat

Partial log (click to expand)

copying path '/nix/store/9c9vryq51hlw0jr8ddk2yk1qvkaq0vl2-curl-7.61.0' from 'https://cache.nixos.org'...
copying path '/nix/store/92pyrnjf90wix80yzphv0z5fqilg88h5-sqlite-3.24.0' from 'https://cache.nixos.org'...
copying path '/nix/store/70k1sw727s6lcwgfaff02axbnsia4rz6-stdenv-linux' from 'https://cache.nixos.org'...
copying path '/nix/store/6b6lzbq74g95j8qlbrdjzkn2ghh81mgy-python-2.7.15' from 'https://cache.nixos.org'...
copying path '/nix/store/ix76xb28kjaj0msbsfdj4dl7q1hk9jl4-weechat-2.1' from 'https://cache.nixos.org'...
copying path '/nix/store/bac623nwawy37l1yndq8iqns7a98gffj-weechat-2.1-python' from 'https://cache.nixos.org'...
copying path '/nix/store/silpcbg8k5bghgilrdvdvw21kvfzzmbz-weechat-2.1-ruby' from 'https://cache.nixos.org'...
copying path '/nix/store/bvxka67lyagz9igy22m8mi3mpj5n3rq9-weechat-plugins' from 'https://cache.nixos.org'...
building '/nix/store/vhcbc7za2lbkmclwvrdgprl8qdarcg4w-weechat.drv'...
/nix/store/iq75mvwy26qf28lhax19867h4i951nym-weechat

@timokau
Copy link
Member

timokau commented Aug 29, 2018

How does that weechat_fifo work? Is it just a file in /etc that is "executed" by weechat at start?

There is the --run-command flag for weechat which could be used for a wrapper. I like the wrapper better because

  • it works outside of nixos
  • it works with home-manager
  • it makes it possible to have multiple weechats with different configs
  • it doesn't require a always-on weechat instance (although its still possible). Users can just start weechat normally

In that case we wouldn't need the weechat-fifo at all right? We could optionally also provide a module to add a weechat systemd service as done here, but that would be separate from the configuration. They could be combined through a pkg option of the module.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: weechat

Partial log (click to expand)

copying path '/nix/store/p4pwl0qb7g5h5zg2nqawki8grizl4plf-lua-5.2.3' from 'https://cache.nixos.org'...
copying path '/nix/store/54w9xzm9jrx9xk5bh11033hl4yikkldq-tcl-8.6.6' from 'https://cache.nixos.org'...
copying path '/nix/store/6gmslna2s5ig360raxcpcza289v1bbn0-weechat-2.1-lua' from 'https://cache.nixos.org'...
copying path '/nix/store/rz4zbcdwyd3rg366w48w5g6r24kf0lbd-weechat-2.1' from 'https://cache.nixos.org'...
copying path '/nix/store/wfycvzamj8wyccc4kis0airlhdl71xzs-weechat-2.1-tcl' from 'https://cache.nixos.org'...
copying path '/nix/store/zy4228z6ya2b8k95kfiyb44n96k5r3gq-guile-2.0.13' from 'https://cache.nixos.org'...
copying path '/nix/store/qr8py347wqkmf9r0phq7ixmpflzgrf7n-weechat-2.1-guile' from 'https://cache.nixos.org'...
copying path '/nix/store/nv0006xh0chz5y0fv7ggim5yra1bkqb2-weechat-plugins' from 'https://cache.nixos.org'...
building '/nix/store/gz0158jcb98mxwn251fpvbh5y7h9dwp9-weechat.drv'...
/nix/store/32phnn0rbgfwj8plhzfg0fjhvham4p7w-weechat

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: weechat

Partial log (click to expand)

/nix/store/iq75mvwy26qf28lhax19867h4i951nym-weechat

@Ma27
Copy link
Member Author

Ma27 commented Aug 31, 2018

I learned about weechat_fifo as an approach to "remotely control" weechat. You could even run a systemd unit during the runtime of weechat with new options.

However --run-command seems to be a reasonable alternative. Please give me some time to think about this, then we can continue the discussion:)

@timokau
Copy link
Member

timokau commented Aug 31, 2018

Of course, looking forward to it :)

@Ma27
Copy link
Member Author

Ma27 commented Sep 5, 2018

@timokau your idea seems fairly reasonable, just implementeda draft for this :)

@Ma27
Copy link
Member Author

Ma27 commented Sep 5, 2018

btw, do you think we can sneak this into 18.09? :)

Copy link
Member

@timokau timokau left a comment

Choose a reason for hiding this comment

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

Awesome, thanks! There is always a bit to nitpick, but looks good overall.

doc/package-notes.xml Show resolved Hide resolved
init = ''
/set foo bar
/server add freenode chat.freenode.org
/even
Copy link
Member

Choose a reason for hiding this comment

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

The first two examples are probably enough 😄

The <literal>configure</literal> method can be used to pass commands to the program:
<programlisting>weechat.override {
configure = { availablePlugins, ... }: {
plugins = builtins.attrValues availablePlugins;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe an example that doesn't install all plugins would be better / more realistic.

Copy link
Member

Choose a reason for hiding this comment

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

Or is this actually the list of available plugins? If so, why have both that and the availablePlugins parameter?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is the original purpose of the configure parameter. You override weechat and tell it which plugins to use (or override one, e.g. use Python with several modules loaded).
This is still needed if you specify configure (which is why I added this line to the docs to provide a working example), but this was implemented before.

Copy link
Member

Choose a reason for hiding this comment

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

Oh right, I forgot that plugins and scripts are two entirely different things. Maybe that should be made explicit in the docs. So this actually just adds all available plugins?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, the terms script and plugin seem to be the same thing, I made the mistake several times as well.

However I don't think that it's needed to add another sentence here, when you have a look at the WeeChat docs in the nixpkgs manual, you'll see that how to configure and use plugins with the Nix package is explained in the previous paragraph.

Copy link
Member

Choose a reason for hiding this comment

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

Right, its easy to get lost in diffs and miss the context. However I think a short aside like "note that plugins are not the same as scripts. See the scripts section for more information" or something when plugins are first introduced may be useful.

Copy link
Member

Choose a reason for hiding this comment

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

Also does that mean that no plugins are installed if I pass in a config without specifying plugins? The default (all plugins) should probably be kept if plugins aren't specified.

Copy link
Member Author

Choose a reason for hiding this comment

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

The code before which configures a weechat environment with the specified plugins explicitly expects a plugin attr which returns a list of plugins to be activated. Unless they're given, an error will be thrown.
The init and scripts attrs are completely optional.

Copy link
Member

Choose a reason for hiding this comment

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

Why not change inherit (config) plugins to plugins = config.plugins or availablePlugins? Requiring that argument made sense when it was the only argument but makes less sense now. I suspect most people don't care much about a couple of MB in the closure size of an end user application.

doc/package-notes.xml Outdated Show resolved Hide resolved
</para>
<para>
The addition of the <literal>init</literal> parameter to the <literal>override</literal> API
of WeeChat allows <literal>Nix</literal> to generate packages that autoconfigure themselves.
Copy link
Member

Choose a reason for hiding this comment

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

What does this mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

You can set values for your scripts before weechat actually starts. But you're right, re-reading it makes the sentence quite odd 😅

Copy link
Member

Choose a reason for hiding this comment

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

So basically just "you can configure WeeChat"? I think the formulation should be improved, at least I'm having a hard time with it.

plugins = builtins.attrValues availablePlugins;

scripts = [
"${pkgs.weechat-xmpp}/share/jabber.py"
Copy link
Member

Choose a reason for hiding this comment

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

Standardization would be really nice, but not a must in this PR. Without it discoveribility suffers though.

Copy link
Member Author

Choose a reason for hiding this comment

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

ack! I may have made the mistake that I started packaging scripts before a proper weechat support was implemented. I'll keep that in mind, we may want to use a metapackage like weechatScripts anyway:)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah something like

scripts  = with pkgs.weechatScripts [
  xmpp
  matrix-protocol
]

Would be pretty neat. It would be possible to remain backwards compatibility, although I'm not sure if its worth it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure, but I'd even say that this is out of scope. This PR already includes script/config support for the package and a module and I'd say that splitting single scripts into their own metapackage should be done in a second PR.

Regarding the change itself: I'm definetely in favor of it, users don't need to know about the structure inside a given store path, they simply need to know their packages, furthermore this is way more readable IMHO.

Regarding backwards compatibility: I've seen several people using these packages, so I think that just moving them is a bad idea. Let's place them into pkgs/top-level/aliases.nix and print a deprecation warning if this attribute path is used.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah as I said, its not a must-have for this PR. But do consider that changing it afterwards would be harder because of backwards compatibility considerations. Once users start using scripts = <list of store paths>, it would be harder to change that. Also I would assume that there currently are not many users of the already packaged scripts (considering the lack of support in actually loading them). So changes are still easy but will get less so over time.

Regarding the scope of this PR: I'm honestly not entirely convinced by the usefulness of the service module, but I'm fine with it if you think its useful.

Copy link
Member

Choose a reason for hiding this comment

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

Oh I should've read your entire comment first. If you've seen people using them already you could keep the current structure but also add a symlink to a standardized location (and the alias).

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. However I'd much rather keep support for strings as input for scripts, especially on non-NixOS systems with Nix as package manager this may be helpful I guess, so we wouldn't break user's setups.

Copy link
Member

Choose a reason for hiding this comment

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

Scripts outside of the nix store would be an impurity that would make the config less portable. I see how it could be useful however, so if you want to support that its fine by me.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess you're right, packaging weechat scripts shouldn't be too hard.I'll see how much time it costs to implement this, then I may add this to this PR.


init = let
init = config.init or "";
scripts = builtins.concatStringsSep "\n" (map (s: "/script load ${s}") (config.scripts or []));
Copy link
Member

Choose a reason for hiding this comment

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

Why first concat with newlines just to replace them by ;?

in builtins.replaceStrings [ "\n" ] [ ";" ] (scripts + init);

mkWeechat = bin: (writeScriptBin bin ''
#!${stdenv.shell}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't makeWrapper be capable of all this?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe its easier without makeWrapper though, not sure.

#!${stdenv.shell}
export WEECHAT_EXTRA_LIBDIR=${pluginsDir}
${lib.concatMapStringsSep "\n" (p: lib.optionalString (p ? extraEnv) p.extraEnv) plugins}
exec ${weechat}/bin/${bin} --run-command "${init}" "$@"
Copy link
Member

Choose a reason for hiding this comment

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

If subsequent --run-commands overwrite the first one, maybe we could check for --run-command or -r in $@ and concat the two. It would add a bit of complexity but just silently overwriting may confuse users.

@timokau
Copy link
Member

timokau commented Sep 5, 2018

18.09

Not sure what the policy for the "feature freeze" is. I'd be in favor (since this doesn't update weechat and is unlikely to break anything) but we should ask one of the release managers once this is merged.

@Ma27
Copy link
Member Author

Ma27 commented Sep 6, 2018

@timokau thanks a lot for your feedback! Would you mind having a look at this a second time? :)

@Ma27
Copy link
Member Author

Ma27 commented Sep 6, 2018

@timokau I added myself as maintainer and introduced the weechatScripts metapackage to load scripts on startup. Would you mind having another look? :)

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: weechat

Partial log (click to expand)

strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/1c3drc6cfx3w0xa4hai4ii3gnyb8fhf2-weechat-2.2-python/lib
patching script interpreter paths in /nix/store/1c3drc6cfx3w0xa4hai4ii3gnyb8fhf2-weechat-2.2-python
checking for references to /build in /nix/store/1c3drc6cfx3w0xa4hai4ii3gnyb8fhf2-weechat-2.2-python...
building '/nix/store/i3afih08s06c5wb9b9jsj00nck3wyaxg-weechat-plugins.drv'...
building '/nix/store/bj3ibijv09dh8q224n0xc268dln0xyib-weechat-headless.drv'...
building '/nix/store/5gay07v7b8qhdjiv4if2hshq03fj8igg-weechat.drv'...
building '/nix/store/2bcyrzs2k9rsg074qnmvcsq0f3d92r7r-weechat-bin-env.drv'...
created 2 symlinks in user environment
/nix/store/gkmkgwr85fsyxw147c90rvajqij2pl7r-weechat-bin-env

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: weechat

Partial log (click to expand)

strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/ncgf7b9c9iiflw8qngi2argvl749zr13-weechat-2.2-python/lib
patching script interpreter paths in /nix/store/ncgf7b9c9iiflw8qngi2argvl749zr13-weechat-2.2-python
checking for references to /build in /nix/store/ncgf7b9c9iiflw8qngi2argvl749zr13-weechat-2.2-python...
building '/nix/store/02y5rfbm4q4smv92qa3xb31a65zv165v-weechat-plugins.drv'...
building '/nix/store/2wnb41yg1s6bbwaz6i13wkxm304awya8-weechat-headless.drv'...
building '/nix/store/f2kfwhh1f2hj519w2likc6nsj9imr9lr-weechat.drv'...
building '/nix/store/6pg1xpiskkslqw1g9jbxfdky7m9rcdvs-weechat-bin-env.drv'...
created 2 symlinks in user environment
/nix/store/5sx11mjwaq4mil6mm25k36kwg949blrs-weechat-bin-env

@timokau
Copy link
Member

timokau commented Sep 7, 2018

Great, thank you for your patience :) Looks good now.

Just FYI, GitHub doesn't send email notifications when you force-push. I only noticed because of ofBorgs rebuilds.

@timokau timokau merged commit e326c01 into NixOS:master Sep 7, 2018
@timokau
Copy link
Member

timokau commented Sep 7, 2018

@samueldr can we include this in 18.09? It

  • updates weechat one minor version
  • adds a module that runs weechat in the background (for IRC log persistency)
  • adds configurability and script (plugin) support to weechat

Since weechat doesn't have reverse dependencies and breakage is very unlikely I think it should be included. What do you think?

@Ma27 Ma27 deleted the nixos/weechat-module branch September 7, 2018 15:27
@timokau
Copy link
Member

timokau commented Sep 7, 2018

#46324 should also be included in 18.09 if we include this.

@samueldr
Copy link
Member

samueldr commented Sep 8, 2018

Oof, the backport policies are really about updating software, and updating software revisions for non-major updates. I don't know if a new module should be backported. it's kind of a lot of things, and the package has deviated considerably compared to how it worked prior to this PR.

SInce nix, nixos and modules can be composed pretty easily, I'm not sure this should be backported. Though the version update (only) could and probably should be backported. (Though it does not seem to have security fixes, it does have stability fixes.)

I'm not strictly against backporting this, but I'm not sure it should be. I'm don'T know about previous precedents of backports of non-trivial module updates. And then this would create such a precedent.

Thoughts, @vcunat?

@timokau
Copy link
Member

timokau commented Sep 8, 2018 via email

@timokau
Copy link
Member

timokau commented Sep 8, 2018

Note that while #46324 was a breakage, it was not a regression. Just a small bug in the newly added features.

@vcunat
Copy link
Member

vcunat commented Sep 14, 2018

@samueldr: it's just a new module, right? Those who don't enable it shouldn't be affected at all by that.

@timokau
Copy link
Member

timokau commented Sep 14, 2018

A new module and configurability added to the weechat package. Still shouldn't affect anybody not using it.

@samueldr
Copy link
Member

Sorry, I meant to reply earlier.

I must have misread that it was changing an existing module. Probably by relying on the description "removing [...] adding support for [...]" instead of looking at the actual code.

In that case it is a fine candidate for a backport I guess.

@Ma27
Copy link
Member Author

Ma27 commented Sep 18, 2018

Sorry, I meant to reply earlier.

No worries, we've learned at last NixCon that release management is quite a hard and time-consuming task :)

In that case it is a fine candidate for a backport I guess.

great! I'm currently using the changes with a recent 18.09 checkout personally, I'll recheck and file a PR later to do the backport, ok?

@samueldr
Copy link
Member

Yes, you can tag me in the backport PR. Thanks for making the PR!

@Ma27 Ma27 mentioned this pull request Sep 18, 2018
9 tasks
@dtzWill
Copy link
Member

dtzWill commented Sep 25, 2018

Hey--how is this intended to be used? Anyone have an example?

The documentation suggests this is geared so that you can attach to the screen session (command to do so is mentioned, and modification to screenrc suggested, etc.), but that is a non-starter AFAICT since screen needs to be suid for that to work and our screen is not.

Which makes me wonder--given this was merged so recently... how are folks using it? Or is there a way to attach I'm missing (sorry!)? Or to run as a user service, perhaps? Thanks!

@Ma27
Copy link
Member Author

Ma27 commented Sep 25, 2018

Hey! Thanks a lot for you interest in this module!
Unfortunately I'll a bit busy in the next days, so please give me some time, then I'll have a deeper look at the issue, ok? :)

@dtzWill
Copy link
Member

dtzWill commented Sep 25, 2018

Sure thing! No hurry at all :). See you in a few!

@samueldr samueldr mentioned this pull request Oct 6, 2018
8 tasks
@Ma27
Copy link
Member Author

Ma27 commented Oct 6, 2018

first of all sorry for the delay, I meant write earlier.

After debugging I realised that I used a screen with setuid on my server (as I needed it for some experiments earlier). During next week I'll whats the best way to implement this and file a patch:)

Ma27 added a commit to Ma27/nixpkgs that referenced this pull request Oct 10, 2018
…er capabilities

Previously you either had to set the setuid bit yourself or workaround
`isSystemUser = true` (for a loginable shell) to access the weechat
screen.

`programs.screen` shouldn't do this by default to avoid taking too much
assumptions about the setup, however `services.weechat` explicitly
requires tihs.

See NixOS#45728
Ma27 added a commit to Ma27/nixpkgs that referenced this pull request Oct 17, 2018
…er capabilities

Previously you either had to set the setuid bit yourself or workaround
`isSystemUser = true` (for a loginable shell) to access the weechat
screen.

`programs.screen` shouldn't do this by default to avoid taking too much
assumptions about the setup, however `services.weechat` explicitly
requires tihs.

See NixOS#45728

(cherry picked from commit 018573b)
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

7 participants