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/prosody: add user/group options, fix pidfile path #38820
nixos/prosody: add user/group options, fix pidfile path #38820
Conversation
@GrahamcOfBorg test prosody |
Failure on aarch64-linux (full log) Attempted: tests.prosody Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: tests.prosody Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: tests.prosody Partial log (click to expand)
|
@GrahamcOfBorg build prosody |
Success on aarch64-linux (full log) Attempted: prosody Partial log (click to expand)
|
From the prosody nixos test logs above, looks like the test vm kernel is broken. |
6fffa53
to
350fded
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Works for me, nixos/prosody: fix pidfile path
change fixed working when dataDir
is put under home directory, say /home/user/prosody
. Before there was an error Couldn't write pidfile at /home/gnidorah/prosody/prosody.pid; /home/gnidorah/prosody/prosody.pid: Permission denied
uid = config.ids.uids.prosody; | ||
description = "Prosody user"; | ||
createHome = true; | ||
group = "prosody"; | ||
group = "${cfg.group}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inherit (cfg) group
@@ -494,9 +506,11 @@ in | |||
wantedBy = [ "multi-user.target" ]; | |||
restartTriggers = [ config.environment.etc."prosody/prosody.cfg.lua".source ]; | |||
serviceConfig = { | |||
User = "prosody"; | |||
User = "${cfg.user}"; | |||
Group = "${cfg.user}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User = cfg.user;
Group = cfg.group;
@@ -475,15 +487,15 @@ in | |||
'') cfg.virtualHosts) } | |||
''; | |||
|
|||
users.extraUsers.prosody = { | |||
users.extraUsers."${cfg.user}" = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the user should only be created if cfg.user == prosody
. Same for the group.
350fded
to
3e81f81
Compare
Fixed, thanks for the review! |
@@ -475,15 +487,15 @@ in | |||
'') cfg.virtualHosts) } | |||
''; | |||
|
|||
users.extraUsers.prosody = { | |||
users.extraUsers.prosody = mkIf (cfg.user == prosody) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prosody should be in quotes
3e81f81
to
ec1419b
Compare
Fixed, tested. Thanks! |
@GrahamcOfBorg test prosody |
Failure on x86_64-linux (full log) Attempted: tests.prosody Partial log (click to expand)
|
Ran the test manually and can confirm it works. |
Failure on aarch64-linux (full log) Attempted: tests.prosody Partial log (click to expand)
|
Motivation for this change
Prosody service options needed improvement
dataDir
, not under/run
as usualThings done
services.prosody.user
andservices.prosody.group
options and implementationRuntimeDirectory
to systemd service configbuild-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)