adds flake and direnv setup

This commit is contained in:
Dennis Schoepf 2026-02-16 21:24:09 +01:00
parent efae6283bb
commit 2c65bc585e
3 changed files with 3473 additions and 0 deletions

5
.envrc Normal file
View file

@ -0,0 +1,5 @@
# shellcheck shell=bash
if ! has nix_direnv_version || ! nix_direnv_version 3.1.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.1.0/direnvrc" "sha256-yMJ2OVMzrFaDPn7q8nCBZFRYpL/f0RcHzhmw/i6btJM="
fi
use flake

58
flake.nix Normal file
View file

@ -0,0 +1,58 @@
{
description = "A basic flake with a shell";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.systems.url = "github:nix-systems/default";
inputs.flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
outputs =
{ nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
bashInteractive
# Executables
nodejs
pnpm
biome
postgresql
# Dev Tools
typescript-language-server
astro-language-server
];
shellHook = ''
export PORT=300
export PGDIR=$PWD/postgres
export PGHOST=$PGDIR
export PGDATA=$PGDIR/data
export PGLOG=$PGDIR/log
export DATABASE_URL="postgresql:///postgres?host=$PGDIR"
if test ! -d $PGDIR; then
mkdir $PGDIR
fi
if [[ ! -d "$PGDATA" ]]; then
initdb $PGDATA --auth=trust >/dev/null
cat >> "$PGDATA/postgresql.conf" <<-EOF
unix_socket_directories = '$PGHOST'
EOF
fi
echo "Bun Version: $(bun --version)"
'';
};
}
);
}

3410
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load diff