Skip to content

feat: a nix package, config and devShell for supabase-auth#2020

Closed
samrose wants to merge 3 commits into
masterfrom
sam/packaged-auth
Closed

feat: a nix package, config and devShell for supabase-auth#2020
samrose wants to merge 3 commits into
masterfrom
sam/packaged-auth

Conversation

@samrose

@samrose samrose commented May 12, 2025

Copy link
Copy Markdown

Add Nix Flake for Supabase Auth Service

Overview

This PR adds a Nix flake configuration for the Supabase Auth service, providing a reproducible build environment and configuration management system. The flake packages the Go application and generates configuration files based on a Nix module system.

Key Features

  • Reproducible Builds: Uses buildGoModule to create a reproducible build of the auth service
  • Configuration Management: Implements a Nix module system for managing service configuration
  • Multi-platform Support: Supports multiple systems (x86_64-linux, aarch64-linux, aarch64-darwin)
  • Development Environment: Includes a development shell with all necessary Go tools

Configuration

The flake provides two main configuration components:

  1. Auth Module: Defines all service configuration options with sensible defaults
  2. Management Script: Generates a manage-auth script for controlling the service

Environment Variables

The configuration supports both legacy and GOTRUE_-prefixed environment variables:

{
  GOTRUE_DB_DRIVER = "postgres";
  GOTRUE_SITE_URL = "http://localhost:3000";
  SITE_URL = "http://localhost:3000";
  # ... other configuration options
}

Usage

Building

nix build

Development

nix develop

Running the Service

./result/bin/manage-auth start

Requirements

  • PostgreSQL database running (default: localhost:5432)
  • Database user and password configured in the settings

Todo

Testing

  • The flake will be able to run the test suite with:
nix flake check -L

gh action CI

  • To build and cache the package

@coveralls

coveralls commented May 12, 2025

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 15089670950

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 9 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.3%) to 69.637%

Files with Coverage Reduction New Missed Lines %
internal/api/web3.go 9 88.98%
Totals Coverage Status
Change from base Build 14865651045: 0.3%
Covered Lines: 10949
Relevant Lines: 15723

💛 - Coveralls

@samrose samrose changed the title feat: a nix package, comfig and devShell for supabase-auth feat: a nix package, config and devShell for supabase-auth May 12, 2025
@cstockton

Copy link
Copy Markdown
Contributor

Thanks for your efforts here, but we can't accept this pr as we don't intend on maintaining auth packages in this repository. For big undertakings like this my suggestion is to follow the contributing guidelines and open an issue to discuss things first.

@cstockton cstockton closed this Feb 23, 2026
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.

3 participants