Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

Deployment fails when Application/Migration directory doesn't exist, causing Nix evaluation error followed by Unit migrate.service not found.

Changes

  • NixOS options (NixSupport/nixosModules/options.nix): Made migrations nullable (types.nullOr types.path) with default null

  • Migrate service (NixSupport/nixosModules/services/migrate.nix): Conditionally define service only when cfg.migrations != null using lib.mkIf

  • Deploy script (flake-module.nix): Check service exists before attempting to start it via systemctl list-unit-files

  • Documentation (Guide/deployment.markdown): Annotate example configs to indicate migrations line is optional

Usage

Users can now omit the migrations configuration entirely:

services.ihp = {
    domain = "example.com";
    # migrations = ./Application/Migration;  # Optional - omit if not using migrations
    schema = ./Application/Schema.sql;
    fixtures = ./Application/Fixtures.sql;
    sessionSecret = "xxx";
};

Or explicitly set to null:

services.ihp = {
    domain = "example.com";
    migrations = null;  # Explicitly disable migrations
    schema = ./Application/Schema.sql;
    # ...
};
Original prompt

This section details on the original issue you should resolve

<issue_title>Allow deploy without any migration</issue_title>
<issue_description>image

As a workaround I've added a dummy empty SQL migrate file

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: mpscholten <2072185+mpscholten@users.noreply.github.com>
Copilot AI changed the title [WIP] Allow deployment without any migration files Make migrations optional in deployment configuration Dec 11, 2025
Copilot AI requested a review from mpscholten December 11, 2025 15:50
@mpscholten mpscholten marked this pull request as ready for review December 12, 2025 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow deploy without any migration

2 participants