A nix flake for agensgraph
Find a file
2026-02-07 20:47:44 +01:00
patches Add Patches from Nixpkgs 2026-02-07 17:11:32 +01:00
.gitignore Initial commit 2026-02-07 02:48:14 +01:00
flake.lock Add Patches from Nixpkgs 2026-02-07 17:11:32 +01:00
flake.nix Compatibility with nixos services.postgresql 2026-02-07 20:47:44 +01:00
README.md Compatibility with nixos services.postgresql 2026-02-07 20:47:44 +01:00

agensgraph-nix

A nix flake wrapping AgensGraph, a multi-model graph database based on PostgreSQL.

Usage

Using the overlay

Add the flake to your inputs and apply the overlay to get agensgraph as a package in nixpkgs:

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    agensgraph = {
      url = "github:0Tick/agensgraph-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { self, nixpkgs, agensgraph, ... }:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs {
        inherit system;
        overlays = [ agensgraph.overlays.default ];
      };
    in
    {
      # Now pkgs.agensgraph is available under pkgs
      devShells.${system}.default = pkgs.mkShell {
        packages = [ pkgs.agensgraph ];
      };
    };
}

NixOS module

You can use AgensGraph with the standard NixOS PostgreSQL service:

{ pkgs, ... }:
{
  services.postgresql = {
    enable = true;
    package = pkgs.agensgraph;
  };
}

With extensions

AgensGraph supports PostgreSQL 16 extensions via withPackages:

pkgs.agensgraph.withPackages (ps: [ ps.postgis ps.pg_cron ])

JIT support

A JIT-enabled variant is available:

# Via the packages output
agensgraph.packages.${system}.agensgraph-jit

# Or toggle on an existing package
pkgs.agensgraph.withJIT