Give postgres a consistent user
This commit is contained in:
parent
7205859ddd
commit
c8746c01ef
|
@ -60,6 +60,7 @@ let
|
||||||
"${stateDirectory}/postgres:/var/lib/postgresql/data:Z"
|
"${stateDirectory}/postgres:/var/lib/postgresql/data:Z"
|
||||||
"${postgresCfg.configFile}:/etc/postgresql.conf"
|
"${postgresCfg.configFile}:/etc/postgresql.conf"
|
||||||
];
|
];
|
||||||
|
user = "${toString postgresCfg.uid}:${toString postgresCfg.uid}";
|
||||||
env_file = [ postgresCfg.envFile ];
|
env_file = [ postgresCfg.envFile ];
|
||||||
restart = "always";
|
restart = "always";
|
||||||
};
|
};
|
||||||
|
@ -306,9 +307,15 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.lemmy-pictrs = {
|
users.users = {
|
||||||
isSystemUser = true;
|
lemmy-pictrs = {
|
||||||
group = "lemmy-pictrs";
|
isSystemUser = true;
|
||||||
|
group = "lemmy-pictrs";
|
||||||
|
};
|
||||||
|
lemmy-postgres = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "lemmy-postgres";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
|
@ -352,6 +359,7 @@ in {
|
||||||
image = cfg.docker-images.postgres;
|
image = cfg.docker-images.postgres;
|
||||||
envFile = hostSecrets.lemmyPostgresEnv.target-file;
|
envFile = hostSecrets.lemmyPostgresEnv.target-file;
|
||||||
configFile = hostSecrets.lemmyPostgresCfg.target-file;
|
configFile = hostSecrets.lemmyPostgresCfg.target-file;
|
||||||
|
uid = config.users.users.lemmy-postgres.uid;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in { imports = [ lemmyImage ]; };
|
in { imports = [ lemmyImage ]; };
|
||||||
|
|
Loading…
Reference in New Issue