Files
timmal/nix/shell.nix
Lucien Cartier-Tilet ea28a87860
All checks were successful
ci / ci (push) Successful in 19m53s
feat: authentication with OAuth
2025-12-10 21:21:38 +01:00

77 lines
2.3 KiB
Nix
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
inputs,
pkgs,
...
}:
inputs.devenv.lib.mkShell
{
inherit inputs pkgs;
modules = [
({
pkgs,
config,
...
}: {
packages = with pkgs; [
rustywind
nodePackages.prettier
nodePackages.eslint
# Node
nodejs_24
nodePackages.pnpm
playwright-driver.browsers
pocketbase
];
services.mailpit = {
enable = true;
# HTTP interface for viewing emails
uiListenAddress = "127.0.0.1:8025";
# SMTP server for receiving emails
smtpListenAddress = "127.0.0.1:1025";
};
processes = with pkgs; {
pocketbase.exec = "${pocketbase}/bin/pocketbase serve --dir ${config.devenv.root}/pb_data --dev";
dev.exec = "${nodePackages.pnpm}/bin/pnpm dev";
};
env = let
browsers = (builtins.fromJSON (builtins.readFile "${pkgs.playwright-driver}/browsers.json")).browsers;
chromium-rev = (builtins.head (builtins.filter (x: x.name == "chromium") browsers)).revision;
in {
PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright.browsers}";
PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS = true;
PLAYWRIGHT_NODEJS_PATH = "${pkgs.nodejs}/bin/node";
PLAYWRIGHT_LAUNCH_OPTIONS_EXECUTABLE_PATH = "${pkgs.playwright.browsers}/chromium-${chromium-rev}/chrome-linux/chrome";
};
scripts.intro.exec = ''
playwrightNpmVersion="$(pnpm show @playwright/test version)"
echo " Playwright nix version: ${pkgs.playwright.version}"
echo "📦 Playwright pnpm version: $playwrightNpmVersion"
if [ "${pkgs.playwright.version}" != "$playwrightNpmVersion" ]; then
echo " Playwright versions in nix (in devenv.yaml) and pnpm (in package.json) are not the same! Please adapt the configuration."
else
echo " Playwright versions in nix and npm are the same"
fi
echo
env | grep ^PLAYWRIGHT
'';
enterShell = ''
echo "🚀 Nuxt.js development environment loaded!"
echo "📦 Node.js version: $(node --version)"
echo "📦 pnpm version: $(pnpm --version)"
echo ""
echo "Run 'pnpm install' to install dependencies"
echo "Run 'pnpm dev' to start the development server"
intro
'';
})
];
}