"builds.sr.ht".debug-port = mkDefault port;
# Configures the SQLAlchemy connection string for the database.
"builds.sr.ht".connection-string = mkDefault "postgresql:///${database}?user=${user}&host=/var/run/postgresql";
- # Set to "yes" to automatically run migrations on package upgrade.
- "builds.sr.ht".migrate-on-upgrade = mkDefault "yes";
# builds.sr.ht's OAuth client ID and secret for meta.sr.ht
# Register your client at meta.example.org/oauth
"builds.sr.ht".oauth-client-id = mkDefault null;
settings = mkOption {
type = lib.types.submodule {
freeformType = settingsFormat.type;
+ options."builds.sr.ht" = {
+ migrate-on-upgrade = mkEnableOption "automatically run migrations on package upgrade";
+ };
+ options."dispatch.sr.ht" = {
+ migrate-on-upgrade = mkEnableOption "automatically run migrations on package upgrade";
+ };
+ options."git.sr.ht" = {
+ migrate-on-upgrade = mkEnableOption "automatically run migrations on package upgrade";
+ };
+ options."hg.sr.ht" = {
+ migrate-on-upgrade = mkEnableOption "automatically run migrations on package upgrade";
+ };
+ options."hub.sr.ht" = {
+ migrate-on-upgrade = mkEnableOption "automatically run migrations on package upgrade";
+ };
+ options."lists.sr.ht" = {
+ migrate-on-upgrade = mkEnableOption "automatically run migrations on package upgrade";
+ };
+ options."man.sr.ht" = {
+ migrate-on-upgrade = mkEnableOption "automatically run migrations on package upgrade";
+ };
+ options."meta.sr.ht" = {
+ migrate-on-upgrade = mkEnableOption "automatically run migrations on package upgrade";
+ };
+ options."paste.sr.ht" = {
+ migrate-on-upgrade = mkEnableOption "automatically run migrations on package upgrade";
+ };
+ options."todo.sr.ht" = {
+ migrate-on-upgrade = mkEnableOption "automatically run migrations on package upgrade";
+ };
};
default = { };
description = ''
"dispatch.sr.ht".debug-port = mkDefault port;
# Configures the SQLAlchemy connection string for the database.
"dispatch.sr.ht".connection-string = mkDefault "postgresql:///${database}?user=${user}&host=/var/run/postgresql";
- # Set to "yes" to automatically run migrations on package upgrade.
- "dispatch.sr.ht".migrate-on-upgrade = mkDefault "yes";
# dispatch.sr.ht's OAuth client ID and secret for meta.sr.ht
# Register your client at meta.example.org/oauth
"dispatch.sr.ht".oauth-client-id = mkDefault null;
"git.sr.ht".debug-port = mkDefault port;
# Configures the SQLAlchemy connection string for the database.
"git.sr.ht".connection-string = mkDefault "postgresql:///${database}?user=${user}&host=/var/run/postgresql";
- # Set to "yes" to automatically run migrations on package upgrade.
- "git.sr.ht".migrate-on-upgrade = mkDefault "yes";
# The redis connection used for the webhooks worker
"git.sr.ht".webhooks = mkDefault "redis://${rcfg.bind}:${toString rcfg.port}/1";
"hub.sr.ht".debug-port = mkDefault port;
# Configures the SQLAlchemy connection string for the database.
"hub.sr.ht".connection-string = mkDefault "postgresql:///${database}?user=${user}&host=/var/run/postgresql";
- # Set to "yes" to automatically run migrations on package upgrade.
- "hub.sr.ht".migrate-on-upgrade = mkDefault "yes";
# hub.sr.ht's OAuth client ID and secret for meta.sr.ht
# Register your client at meta.example.org/oauth
"hub.sr.ht".oauth-client-id = mkDefault null;
"lists.sr.ht".debug-port = mkDefault port;
# Configures the SQLAlchemy connection string for the database.
"lists.sr.ht".connection-string = mkDefault "postgresql:///${database}?user=${user}&host=/var/run/postgresql";
- # Set to "yes" to automatically run migrations on package upgrade.
- "lists.sr.ht".migrate-on-upgrade = mkDefault "yes";
# lists.sr.ht's OAuth client ID and secret for meta.sr.ht
# Register your client at meta.example.org/oauth
"lists.sr.ht".oauth-client-id = mkDefault null;
"man.sr.ht".debug-port = mkDefault port;
# Configures the SQLAlchemy connection string for the database.
"man.sr.ht".connection-string = mkDefault "postgresql:///${database}?user=${user}&host=/var/run/postgresql";
- # Set to "yes" to automatically run migrations on package upgrade.
- "man.sr.ht".migrate-on-upgrade = mkDefault "yes";
# man.sr.ht's OAuth client ID and secret for meta.sr.ht
# Register your client at meta.example.org/oauth
"man.sr.ht".oauth-client-id = mkDefault null;
"meta.sr.ht".debug-port = mkDefault port;
# Configures the SQLAlchemy connection string for the database.
"meta.sr.ht".connection-string = mkDefault "postgresql:///${database}?user=${user}&host=/var/run/postgresql";
- # Set to "yes" to automatically run migrations on package upgrade.
- "meta.sr.ht".migrate-on-upgrade = mkDefault "yes";
# If "yes", the user will be sent the stock sourcehut welcome emails after
# signup (requires cron to be configured properly). These are specific to the
# sr.ht instance so you probably want to patch these before enabling this.
"paste.sr.ht".debug-port = mkDefault port;
# Configures the SQLAlchemy connection string for the database.
"paste.sr.ht".connection-string = mkDefault "postgresql:///${database}?user=${user}&host=/var/run/postgresql";
- # Set to "yes" to automatically run migrations on package upgrade.
- "paste.sr.ht".migrate-on-upgrade = mkDefault "yes";
# paste.sr.ht's OAuth client ID and secret for meta.sr.ht
# Register your client at meta.example.org/oauth
"paste.sr.ht".oauth-client-id = mkDefault null;
touch ${statePath}/webhook
fi
- ${optionalString (builtins.hasAttr "migrate-on-upgrade" cfgIni && cfgIni.migrate-on-upgrade == "yes") ''
+ ${optionalString (builtins.trace iniKey cfgIni).migrate-on-upgrade ''
if [ "$(cat ${statePath}/db)" != "${serviceDrv.version}" ]; then
# Manage schema migrations using alembic
${cfg.python}/bin/${serviceDrv.pname}-migrate -a upgrade head
"todo.sr.ht".debug-port = mkDefault port;
# Configures the SQLAlchemy connection string for the database.
"todo.sr.ht".connection-string = mkDefault "postgresql:///${database}?user=${user}&host=/var/run/postgresql";
- # Set to "yes" to automatically run migrations on package upgrade.
- "todo.sr.ht".migrate-on-upgrade = mkDefault "yes";
# todo.sr.ht's OAuth client ID and secret for meta.sr.ht
# Register your client at meta.example.org/oauth
"todo.sr.ht".oauth-client-id = mkDefault null;