nixos/weechat: Set up state directory
In preparation for dropping the user home directory, set up the state directory manually. Use the systemd unit options when /var/lib/weechat is used and use systemd-tmpfiles for all other locations. Not sure if it makes any difference. However, it seems systemd tends to control its directories in /var/lib and so it might make more sense to use the existing options of the systemd unit. This doesn't change the current behaviour. Signed-off-by: Felix Singer <felixsinger@posteo.net>
This commit is contained in:
@@ -44,10 +44,22 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
systemd.tmpfiles.settings."weechat" = {
|
||||
"${cfg.root}" = lib.mkIf (cfg.root != "/var/lib/weechat") {
|
||||
d = {
|
||||
user = "weechat";
|
||||
group = "weechat";
|
||||
mode = "750";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.weechat = {
|
||||
serviceConfig = {
|
||||
User = "weechat";
|
||||
Group = "weechat";
|
||||
StateDirectory = lib.mkIf (cfg.root == "/var/lib/weechat") "weechat";
|
||||
StateDirectoryMode = 750;
|
||||
RemainAfterExit = "yes";
|
||||
};
|
||||
script = "exec ${config.security.wrapperDir}/screen -Dm -S ${cfg.sessionName} ${cfg.binary} --dir ${cfg.root}";
|
||||
|
||||
Reference in New Issue
Block a user