generated from coulomb/repo-seed
fix(WP-0014/A2): fix devenv shell — IHP_LIB, ghci, ghcid now available
Some checks failed
Test / test (push) Has been cancelled
Some checks failed
Test / test (push) Has been cancelled
Root cause: devenv shell reads devenv.nix only; IHP's Haskell setup is in flake.nix's devenv.shells.default which is only loaded by nix develop. Fix: create devenv.yaml to register IHP as a devenv input (pinned to the same rev as flake.lock) with overlays.default applied. Update devenv.nix to set IHP_LIB/IHP env vars and enable languages.haskell with pkgs.ghc (IHP-overlay GHC) + all project packages; add ghcid explicitly. devenv.lock pins IHP at df3922d (matches flake.lock). scripts/compile-check: updated header comments and added IHP_LIB echo; switches from ghcid to ghci one-shot (ghcid not available in all shells). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
58
devenv.nix
58
devenv.nix
@@ -8,17 +8,61 @@
|
||||
# Duplicates the settings from flake.nix devenv.shells.default so they
|
||||
# are applied under both devenv v1 (flake path) and devenv v2 (this file).
|
||||
{ pkgs, lib, config, inputs, ... }:
|
||||
# devenv.nix — devenv v2 shell configuration.
|
||||
#
|
||||
# `devenv shell` reads only this file (not flake.nix's devenv.shells.default).
|
||||
# IHP's flake module configures devenv.shells.default — that is only visible
|
||||
# to `nix develop`. This file therefore duplicates the IHP-critical parts so
|
||||
# that `devenv shell` also has a working Haskell + IHP_LIB environment.
|
||||
#
|
||||
# devenv.yaml registers IHP as a devenv input (pinned rev matching flake.lock)
|
||||
# and applies IHP's nixpkgs overlay, making pkgs.ghc the IHP Haskell package
|
||||
# set (ihp, ihp-hspec, ghcid, etc.).
|
||||
{
|
||||
# Resource limits for constrained host (2 CPU / 3.8 GiB RAM).
|
||||
# -A32m: smaller minor heap, -M2g: hard heap ceiling.
|
||||
# Note: -N1 omitted intentionally (requires -threaded, breaks IHP tools).
|
||||
# GHC parallel module compilation is capped via -j1 in .ghci instead.
|
||||
# ── Resource limits (constrained host: 2 CPU / ~3.8 GiB RAM) ─────────────
|
||||
# -A32m: smaller minor heap; -M2g: hard heap ceiling.
|
||||
# -N1 omitted: requires -threaded, which breaks IHP tools.
|
||||
# GHC parallel module compilation is capped via -j1 in .ghci.
|
||||
env.GHCRTS = "-A32m -M2g";
|
||||
|
||||
# Make tailwindcss available in process scripts (devenv v2 builds process
|
||||
# scripts with only packages declared here, not from flake ihp.packages).
|
||||
packages = [ pkgs.nodePackages.tailwindcss ];
|
||||
# ── IHP environment variables ─────────────────────────────────────────────
|
||||
# IHP_LIB is read by .ghci (applicationGhciConfig) and by scripts/compile-check.
|
||||
# IHP is the legacy name used by older Makefiles.
|
||||
env.IHP_LIB = "${inputs.ihp.packages.${pkgs.stdenv.system}.ihp-env-var-backwards-compat}";
|
||||
env.IHP = "${inputs.ihp.packages.${pkgs.stdenv.system}.ihp-env-var-backwards-compat}";
|
||||
|
||||
# ── Haskell toolchain ─────────────────────────────────────────────────────
|
||||
# IHP's nixpkgs overlay (applied via devenv.yaml overlays) makes pkgs.ghc
|
||||
# the IHP-augmented Haskell package set. pkgs.ghc.ghc is the GHC compiler.
|
||||
languages.haskell.enable = true;
|
||||
languages.haskell.package = pkgs.ghc.ghc.withPackages (p: with p; [
|
||||
p.ihp
|
||||
# Project runtime dependencies (mirrors flake.nix haskellPackages)
|
||||
http-conduit
|
||||
aeson
|
||||
string-conversions
|
||||
cryptohash-sha256
|
||||
base16-bytestring
|
||||
random-bytestring
|
||||
yaml
|
||||
network-uri
|
||||
# Dev / test tools
|
||||
cabal-install
|
||||
hlint
|
||||
hspec
|
||||
p.ihp-hspec
|
||||
]);
|
||||
# ghcid is used by scripts/compile-check-core; not auto-added by devenv.
|
||||
# LSP disabled — heavy binary not needed for CI-style compile checks.
|
||||
languages.haskell.lsp.enable = false;
|
||||
|
||||
# ── Extra packages ────────────────────────────────────────────────────────
|
||||
packages = [
|
||||
pkgs.ghc.ghcid
|
||||
pkgs.nodePackages.tailwindcss
|
||||
];
|
||||
|
||||
# ── Processes ─────────────────────────────────────────────────────────────
|
||||
# Tailwind CSS watcher — not part of IHP's core devenv module.
|
||||
processes.tailwind.exec = "tailwindcss -c tailwind/tailwind.config.js -i ./tailwind/app.css -o static/app.css --watch=always";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user