Skip to content

Commit

Permalink
fix: let module setup be correct
Browse files Browse the repository at this point in the history
  • Loading branch information
CutestNekoAqua committed May 3, 2024
1 parent 9db98ab commit 09874fc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ let
ensureDatabases = lib.singleton cfg.database.dbname;
};
};
dbconfone = lib.mkIf cfg.database.createLocally {
systemd.services.lysandap.serviceConfig.Environment.DATABASE_URL = "postgresql:///${cfg.database.user}@localhost/${cfg.database.dbname}";
};
dbconftwo = lib.mkIf (cfg.database.createLocally == false) {
systemd.services.lysandap.serviceConfig.Environment.DATABASE_URL = "postgresql://${cfg.database.user}:${cfg.database.passwordFile}@${cfg.database.host}:${toString cfg.database.port}/${cfg.database.dbname}";
};
nginxConfig = lib.mkIf cfg.nginx.enable {
services.nginx =
let
Expand Down Expand Up @@ -223,12 +229,8 @@ in
config = mkIf cfg.enable (lib.mkMerge [
localDatabaseConfig
nginxConfig
lib.mkIf cfg.database.createLocally {
systemd.services.lysandap.serviceConfig.Environment.DATABASE_URL = "postgresql:///${cfg.database.user}@localhost/${cfg.database.dbname}";
}
lib.mkIf (cfg.database.createLocally == false) {
systemd.services.lysandap.serviceConfig.Environment.DATABASE_URL = "postgresql://${cfg.database.user}:${cfg.database.passwordFile}@${cfg.database.host}:${toString cfg.database.port}/${cfg.database.dbname}";
}
dbconfone
dbconftwo
{
systemd.services.lysandap = {
wantedBy = [ "multi-user.target" ];
Expand Down

0 comments on commit 09874fc

Please sign in to comment.