Skip to content

Commit c22977f

Browse files
committed
refactor: match with new supabase_potion release
1 parent 2e48e33 commit c22977f

File tree

15 files changed

+377
-332
lines changed

15 files changed

+377
-332
lines changed

.envrc

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,3 @@ export ERL_AFLAGS="-kernel shell_history enabled"
99
export LANG=en_US.UTF-8
1010

1111
use flake
12-
13-
# Setup postgresql
14-
if test -d "/Applications/Postgres.app"; then
15-
export DATABASE_USER="$(whoami)"
16-
export DATABASE_PASSWORD=""
17-
else
18-
# postges related
19-
export DATABASE_USER="supabase_potion"
20-
export DATABASE_PASSWORD="supabase_potion"
21-
export PG_DATABASE="supabase_potion_dev"
22-
# keep all your db data in a folder inside the project
23-
export PGHOST="$PWD/.postgres"
24-
export PGDATA="$PGHOST/data"
25-
export PGLOG="$PGHOST/server.log"
26-
27-
if [[ ! -d "$PGDATA" ]]; then
28-
# initital set up of database server
29-
initdb --auth=trust --no-locale --encoding=UTF8 -U=$DATABASE_USER >/dev/null
30-
31-
# point to correct unix sockets
32-
echo "unix_socket_directories = '$PGHOST'" >> "$PGDATA/postgresql.conf"
33-
# creates loacl database user
34-
echo "CREATE USER $DATABASE_USER SUPERUSER;" | postgres --single -E postgres
35-
# creates local databse
36-
echo "CREATE DATABASE $PG_DATABASE;" | postgres --single -E postgres
37-
fi
38-
fi
39-
40-
source .env

.formatter.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Used by "mix format"
22
[
3-
inputs: ["mix.exs", "config/*.exs"],
4-
subdirectories: ["apps/*"]
3+
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
54
]

flake.lock

Lines changed: 5 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,34 @@
11
{
2-
description = "Supabase SDK for Elixir";
2+
description = "Supabase Storage integration for Elixir";
33

4-
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6-
flake-parts.url = "github:hercules-ci/flake-parts";
7-
systems.url = "github:nix-systems/default";
8-
};
4+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11-small";
5+
6+
outputs = {nixpkgs, ...}: let
7+
inherit (nixpkgs.lib) genAttrs;
8+
inherit (nixpkgs.lib.systems) flakeExposed;
9+
forAllSystems = f:
10+
genAttrs flakeExposed (system: f (import nixpkgs {inherit system;}));
11+
in {
12+
devShells = forAllSystems (pkgs: let
13+
inherit (pkgs) mkShell;
14+
inherit (pkgs.beam.interpreters) erlang_27;
15+
inherit (pkgs.beam) packagesWith;
16+
beam = packagesWith erlang_27;
17+
elixir_1_18 = beam.elixir.override {
18+
version = "1.18.1";
919

10-
outputs = {
11-
flake-parts,
12-
systems,
13-
...
14-
} @ inputs:
15-
flake-parts.lib.mkFlake {inherit inputs;} {
16-
systems = import systems;
17-
perSystem = {
18-
pkgs,
19-
system,
20-
...
21-
}: let
22-
inherit (pkgs.beam.interpreters) erlang_27;
23-
inherit (pkgs.beam) packagesWith;
24-
beam = packagesWith erlang_27;
25-
in {
26-
_module.args.pkgs = import inputs.nixpkgs {
27-
inherit system;
28-
config.allowUnfree = true;
20+
src = pkgs.fetchFromGitHub {
21+
owner = "elixir-lang";
22+
repo = "elixir";
23+
rev = "v1.18.1";
24+
sha256 = "sha256-zJNAoyqSj/KdJ1Cqau90QCJihjwHA+HO7nnD1Ugd768=";
2925
};
30-
devShells.default = with pkgs;
31-
mkShell {
32-
name = "storage-ex";
33-
packages = with pkgs;
34-
[beam.elixir_1_17]
35-
++ lib.optional stdenv.isLinux [inotify-tools]
36-
++ lib.optional stdenv.isDarwin [
37-
darwin.apple_sdk.frameworks.CoreServices
38-
darwin.apple_sdk.frameworks.CoreFoundation
39-
];
40-
};
4126
};
42-
};
27+
in {
28+
default = mkShell {
29+
name = "storage-ex";
30+
packages = with pkgs; [elixir_1_18 postgresql];
31+
};
32+
});
33+
};
4334
}

0 commit comments

Comments
 (0)