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 NixOS#45728
  • Loading branch information
Ma27 committed Oct 10, 2018
1 parent fc84778 commit 018573b
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 018573b

Please sign in to comment.