nix: add basic flake.nix
This just exposes the PostgREST package, not more. The goal is to avoid duplication, so we're re-using only exports from default.nix. Resolves #3026 Supersedes #3105
This commit is contained in:
@@ -130,3 +130,27 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
postgrest-loadtest-against main ${{ steps.get-latest-tag.outputs.tag }}
|
postgrest-loadtest-against main ${{ steps.get-latest-tag.outputs.tag }}
|
||||||
postgrest-loadtest-report >> "$GITHUB_STEP_SUMMARY"
|
postgrest-loadtest-report >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
|
||||||
|
|
||||||
|
flake:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
runs-on:
|
||||||
|
- macos-13 # x86_64-darwin
|
||||||
|
- macos-14 # aarch64-darwin
|
||||||
|
- ubuntu-24.04 # x86_64-linux
|
||||||
|
- ubuntu-24.04-arm # aarch64-linux
|
||||||
|
name: Flake Check
|
||||||
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Setup Nix Environment
|
||||||
|
uses: ./.github/actions/setup-nix
|
||||||
|
with:
|
||||||
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
|
- name: Run flake check
|
||||||
|
run: |
|
||||||
|
nix flake check
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
pacman -S postgrest
|
pacman -S postgrest
|
||||||
|
|
||||||
.. tab:: Nix
|
.. tab:: Nix via nixpkgs
|
||||||
|
|
||||||
You can install PostgREST from nixpkgs.
|
You can install PostgREST from nixpkgs.
|
||||||
|
|
||||||
@@ -36,6 +36,17 @@
|
|||||||
|
|
||||||
nix-env -i postgrest
|
nix-env -i postgrest
|
||||||
|
|
||||||
|
.. tab:: Nix via flake
|
||||||
|
|
||||||
|
You can install PostgREST via flake.
|
||||||
|
|
||||||
|
.. code:: nix
|
||||||
|
|
||||||
|
{
|
||||||
|
inputs.postgrest.url = "github:postgrest/postgrest";
|
||||||
|
# ...
|
||||||
|
}
|
||||||
|
|
||||||
.. group-tab:: Windows
|
.. group-tab:: Windows
|
||||||
|
|
||||||
You can install PostgREST using `Chocolatey <https://community.chocolatey.org/packages/postgrest>`_ or `Scoop <https://github.com/ScoopInstaller/Scoop>`_.
|
You can install PostgREST using `Chocolatey <https://community.chocolatey.org/packages/postgrest>`_ or `Scoop <https://github.com/ScoopInstaller/Scoop>`_.
|
||||||
|
|||||||
Generated
+26
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs-lib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1742692082,
|
||||||
|
"narHash": "sha256-s3XOULQj7BVO7myY5V4Sob0tRZ7nRpwEOIzXg/MkD/Q=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "a09310bc940f245e51b1ffea68731244ca38f2bd",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
description = "REST API for any Postgres database";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs-lib.url = "github:nix-community/nixpkgs.lib";
|
||||||
|
};
|
||||||
|
|
||||||
|
nixConfig = {
|
||||||
|
extra-substituters = "https://postgrest.cachix.org";
|
||||||
|
extra-trusted-public-keys = "postgrest.cachix.org-1:icgW4R15fz1+LqvhPjt4EnX/r19AaqxiVV+1olwlZtI=";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { nixpkgs-lib, ... }:
|
||||||
|
let
|
||||||
|
systems = [
|
||||||
|
"aarch64-darwin"
|
||||||
|
"aarch64-linux"
|
||||||
|
"x86_64-darwin"
|
||||||
|
"x86_64-linux"
|
||||||
|
];
|
||||||
|
|
||||||
|
pgrstFor = system: import ./default.nix {
|
||||||
|
inherit system;
|
||||||
|
};
|
||||||
|
|
||||||
|
genSystems = f: nixpkgs-lib.lib.genAttrs systems (system: f (pgrstFor system));
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = genSystems (attrs: {
|
||||||
|
default = attrs.postgrestPackage;
|
||||||
|
profiled = attrs.postgrestProfiled;
|
||||||
|
} // nixpkgs-lib.lib.optionalAttrs (attrs ? postgrestStatic) {
|
||||||
|
static = attrs.postgrestStatic;
|
||||||
|
});
|
||||||
|
|
||||||
|
apps = genSystems (attrs: {
|
||||||
|
default = {
|
||||||
|
type = "app";
|
||||||
|
program = "${attrs.postgrestStatic or attrs.postgrestPackage}/bin/postgrest";
|
||||||
|
meta.description = "REST API for any Postgres database";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user