Skip to content

Commit

Permalink
Fixed some postgres settings in appWithPostgres nixos config
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten committed Jan 6, 2024
1 parent 8940e30 commit ec29222
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion NixSupport/nixosModules/appWithPostgres.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ in
}
];
initialScript = pkgs.writeText "ihp-initScript" ''
\connect ${cfg.databaseName}
CREATE TABLE IF NOT EXISTS schema_migrations (revision BIGINT NOT NULL UNIQUE);
\i ${ihp}/lib/IHP/IHPSchema.sql
\i ${cfg.schema}
\i ${cfg.fixtures}
'';
};

services.ihp.databaseUrl = ""; # TODO: Set this to some real value
services.ihp.databaseUser = "root";
services.ihp.databaseUrl = "postgresql://${cfg.databaseUser}@/${cfg.databaseName}";

# Enable automatic GC to avoid the disk from filling up
#
Expand All @@ -96,5 +98,10 @@ in

# Saves disk space by detecting and handling identical contents in the Nix Store
nix.settings.auto-optimise-store = true;

environment.variables = {
PGUSER = cfg.databaseUser;
PGDATABASE = cfg.databaseName;
};
}

0 comments on commit ec29222

Please sign in to comment.