Move configs to host as secrets

This commit is contained in:
niten 2023-07-17 11:55:10 -07:00
parent 627147e6a3
commit 8821b8a7bf
1 changed files with 19 additions and 7 deletions

View File

@ -268,6 +268,22 @@ in {
}; };
target-file = "/run/lemmy/postgres.env"; target-file = "/run/lemmy/postgres.env";
}; };
lemmyCfg = {
source-file = makeLemmyCfg {
inherit (cfg) hostname;
inherit postgresPasswd pictrsApiKey;
smtpServer = cfg.smtp-server;
};
target-file = "/run/lemmy/lemmy.hjson";
};
lemmyNgnixCfg = {
source-file = nginxCfgFile;
target-file = "/run/lemmy/nginx.conf";
};
lemmyPostgresCfg = {
source-file = postgresCfgFile;
target-file = "/var/lemmy/postgres.conf";
};
}; };
users.users.lemmy-pictrs = { users.users.lemmy-pictrs = {
@ -287,15 +303,11 @@ in {
stateDirectory = cfg.state-directory; stateDirectory = cfg.state-directory;
proxyCfg = { proxyCfg = {
image = "nginx:1-alpine"; image = "nginx:1-alpine";
configFile = nginxCfgFile; configFile = hostSecrets.lemmyNginxCfg.target-file;
}; };
lemmyCfg = { lemmyCfg = {
image = cfg.docker-images.lemmy; image = cfg.docker-images.lemmy;
configFile = makeLemmyCfg { configFile = hostSecrets.lemmyCfg.target-file;
inherit (cfg) hostname;
inherit postgresPasswd pictrsApiKey;
smtpServer = cfg.smtp-server;
};
envFile = toString (makeEnvFile { envFile = toString (makeEnvFile {
RUST_LOG = "warn"; RUST_LOG = "warn";
RUST_BACKTRACE = "full"; RUST_BACKTRACE = "full";
@ -317,7 +329,7 @@ in {
postgresCfg = { postgresCfg = {
image = cfg.docker-images.postgres; image = cfg.docker-images.postgres;
envFile = hostSecrets.lemmyPostgresEnv.target-file; envFile = hostSecrets.lemmyPostgresEnv.target-file;
configFile = postgresCfgFile; configFile = hostSecrets.lemmyPostgresCfg.target-file;
}; };
}; };
in { imports = [ lemmyImage ]; }; in { imports = [ lemmyImage ]; };