Skip to content

Commit

Permalink
nixos/weechat: add setuid wrapper for `screen' to ensure true multius…
Browse files Browse the repository at this point in the history
…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 #45728

(cherry picked from commit 018573b)
  • Loading branch information
Ma27 committed Oct 17, 2018
1 parent 971b5be commit bfb61a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion nixos/modules/services/misc/weechat.nix
Expand Up @@ -46,10 +46,12 @@ in
Group = "weechat";
RemainAfterExit = "yes";
};
script = "exec ${pkgs.screen}/bin/screen -Dm -S ${cfg.sessionName} ${cfg.binary}";
script = "exec ${config.security.wrapperDir}/screen -Dm -S ${cfg.sessionName} ${cfg.binary}";
wantedBy = [ "multi-user.target" ];
wants = [ "network.target" ];
};

security.wrappers.screen.source = "${pkgs.screen}/bin/screen";
};

meta.doc = ./weechat.xml;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/weechat.xml
Expand Up @@ -54,7 +54,7 @@
</programlisting>
Now, the session can be re-attached like this:
<programlisting>
screen -r weechat-screen
screen -x weechat/weechat-screen
</programlisting>
</para>

Expand Down

0 comments on commit bfb61a7

Please sign in to comment.