From 40d559a98998cb939ce1892690f84ea4fd68177b Mon Sep 17 00:00:00 2001 From: counterweight Date: Thu, 24 Jul 2025 18:04:35 +0200 Subject: [PATCH] nix and makefile stuff --- .env-dist | 13 ++++++++++++ .envrc | 1 + .gitignore | 1 + flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 3 ++- 5 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 .env-dist create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 flake.lock diff --git a/.env-dist b/.env-dist new file mode 100644 index 0000000..948b856 --- /dev/null +++ b/.env-dist @@ -0,0 +1,13 @@ +POSTGRES_APP_HOST=localhost +POSTGRES_APP_USER=app +POSTGRES_APP_PASSWORD=app123 +POSTGRES_APP_DB=app_db +POSTGRES_APP_PORT=5432 + +POSTGRES_DW_HOST=localhost +POSTGRES_DW_USER=dw +POSTGRES_DW_PASSWORD=dw123 +POSTGRES_DW_DB=dw_db +POSTGRES_DW_PORT=5444 + + diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..fe7c01a --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +dotenv diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2eea525 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..2468070 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1735563628, + "narHash": "sha256-OnSAY7XDSx7CtDoqNh8jwVwh4xNL/2HaJxGjryLWzX8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b134951a4c9f3c995fd7be05f3243f8ecd65d798", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 4b6ec83..8051303 100644 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,8 @@ ]; shellHook = '' - export DATABASE_URL=postgres://app:app123@localhost:5432/app_db + export DATABASE_URL="postgres://${POSTGRES_APP_USER}:${POSTGRES_APP_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_APP_PORT}/${POSTGRES_APP_DB}" + export DW_DATABASE_URL="postgres://${POSTGRES_DW_USER}:${POSTGRES_DW_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_DW_PORT}/${POSTGRES_DW_DB}" echo "✅ Rust + PostgreSQL dev env ready" ''; };