Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

samrose
Copy link

@samrose samrose commented May 12, 2025

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
Copy link

coveralls commented May 12, 2025

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
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.

2 participants