This commit is contained in:
2025-09-18 09:23:08 -06:00
parent 4150af64bb
commit b2103a7359
5 changed files with 118 additions and 1 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

61
flake.lock generated Normal file
View File

@@ -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": 1758070117,
"narHash": "sha256-uLwwHFCZnT1c3N3biVe/0hCkag2GSrf9+M56+Okf+WY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e9b7f2ff62b35f711568b1f0866243c7c302028d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.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
}

54
flake.nix Normal file
View File

@@ -0,0 +1,54 @@
{
description = "GlowTrack: reproducible devShell and app build outputs";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
# Developer shell with Node.js LTS, pnpm, git, jq
devShells.default = pkgs.mkShell {
packages = builtins.attrValues {
inherit (pkgs) nodejs_20 pnpm git jq;
};
# Tip: uncomment Playwright bits below once tests are wired (T007)
# packages = builtins.attrValues { inherit (pkgs) nodejs_20 pnpm git jq playwright-driver playwright-browsers; };
# shellHook = ''
# export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-browsers}
# '';
};
# Package: static site output from apps/web
# This derivation copies a prebuilt site (build/ or dist/) from apps/web if present.
# It does not run networked installs, keeping the build pure. The actual build
# step is performed via pnpm in the dev shell (see T005/T030 for CI wiring).
packages.app = pkgs.stdenvNoCC.mkDerivation {
pname = "glowtrack-app";
version = "0.0.0";
src = ./.;
buildPhase = "true";
installPhase = ''
mkdir -p "$out"
if [ -d apps/web/build ]; then
cp -r apps/web/build/* "$out/"
elif [ -d apps/web/dist ]; then
cp -r apps/web/dist/* "$out/"
else
echo "No prebuilt app output detected. After scaffolding (T005), run 'pnpm -C apps/web build' to populate build/ or dist/." > "$out/README.txt"
fi
'';
};
# Make `.#default` point to the app package for convenience
packages.default = self.packages.${system}.app;
}
);
}

1
result Symbolic link
View File

@@ -0,0 +1 @@
/nix/store/a7d43vv7g79mi2da7b977vqy0cqnaa45-glowtrack-app-0.0.0

View File

@@ -25,7 +25,7 @@ Paths below are absolute to this repo.
- Add placeholder README.md in each new folder.
- Dependencies: none
- [ ] T002 Initialize Nix flake (devShell + build outputs)
- [X] T002 Initialize Nix flake (devShell + build outputs)
- Create /home/jawz/Development/Projects/GlowTrack/flake.nix providing:
- devShell with: nodejs (LTS 20+), pnpm, git, playwright browsers (via optional separate task), jq
- packages.app building static site from /apps/web (pnpm build)