add flake.nix for Nix PHP dev shell

This commit is contained in:
Pontoporeia
2026-03-11 12:39:14 +01:00
parent 7208292c0e
commit 46040328a4
3 changed files with 54 additions and 0 deletions

4
.gitignore vendored
View File

@@ -12,6 +12,10 @@ storage/test.db
error.log
src/cache/rate_limit/
# Nix
.direnv/
result
# OS files
.DS_Store
Thumbs.db

View File

@@ -35,6 +35,7 @@
## Pending
- [x] Add flake.nix for Nix-based PHP dev environment
- [x] Add favicon (`<link rel="icon">` → admin_favicon.svg) to all pages; nginx 204 for /favicon.ico
- [ ] Add pagination to répertoire student index (currently capped at 100)
- [ ] Thumbnail generation / cover image support for home grid cards

49
flake.nix Normal file
View File

@@ -0,0 +1,49 @@
{
description = "Post-ERG development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
php = pkgs.php84.buildEnv {
extensions = ({ enabled, all }: enabled ++ (with all; [
curl
mbstring
pdo
pdo_sqlite
sqlite3
]));
extraConfig = ''
error_reporting = E_ALL
display_errors = On
log_errors = On
'';
};
in
{
devShells.default = pkgs.mkShell {
name = "posterg";
packages = [
php
pkgs.sqlite
pkgs.just
pkgs.git
];
shellHook = ''
echo "🛠 Post-ERG dev shell"
echo " php $(php --version | head -1)"
echo " just $(just --version)"
echo ""
echo "Run 'just serve' to start the dev server."
'';
};
});
}