forked from mirrors/nixpkgs
nixos/nginx: fix group and stateDir permissions
furthermore, I don't think adding nginx to systemPackages is of any use.
This commit is contained in:
parent
76c2c0c499
commit
a97bef3e8c
|
@ -84,8 +84,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
environment.systemPackages = [ nginx ];
|
|
||||||
|
|
||||||
# TODO: test user supplied config file pases syntax test
|
# TODO: test user supplied config file pases syntax test
|
||||||
|
|
||||||
systemd.services.nginx = {
|
systemd.services.nginx = {
|
||||||
|
@ -96,6 +94,7 @@ in
|
||||||
preStart =
|
preStart =
|
||||||
''
|
''
|
||||||
mkdir -p ${cfg.stateDir}/logs
|
mkdir -p ${cfg.stateDir}/logs
|
||||||
|
chmod 700 ${cfg.stateDir}
|
||||||
chown -R ${cfg.user}:${cfg.group} ${cfg.stateDir}
|
chown -R ${cfg.user}:${cfg.group} ${cfg.stateDir}
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
@ -105,7 +104,7 @@ in
|
||||||
|
|
||||||
users.extraUsers = optionalAttrs (cfg.user == "nginx") (singleton
|
users.extraUsers = optionalAttrs (cfg.user == "nginx") (singleton
|
||||||
{ name = "nginx";
|
{ name = "nginx";
|
||||||
group = "nginx";
|
group = cfg.group;
|
||||||
uid = config.ids.uids.nginx;
|
uid = config.ids.uids.nginx;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue