Skip to content

Commit 185eb74

Browse files
hyperpolymathclaude
andcommitted
echo-types: add Nix flake devShell for use flake
The .envrc declared `use flake` but no flake.nix existed, so direnv failed. Add a devShell pinned to nixpkgs nixos-24.11: - rustc 1.82.0 + cabal-install 3.12.1.0 (exact .tool-versions match), agda 2.7.0.1, ghc 9.6.6, just 1.38.0 - Agda libraries: standard-library (nixpkgs, reproducible) + absolute-zero (local ~/dev/repos checkout; no usable upstream pkg), wired via a generated AGDA_DIR/libraries in the shellHook - .gitignore: ignore the generated .agda/ dir Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4b9bbda commit 185eb74

3 files changed

Lines changed: 99 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.agdai
22
arghda-core/target/
33
.claude/
4+
.agda/

flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
# SPDX-License-Identifier: PMPL-1.0-or-later
3+
#
4+
# Development environment for echo-types. Consumed by .envrc (`use flake`).
5+
# Toolchain mirrors .tool-versions (cabal / rust / just) plus Agda, which
6+
# the Justfile and echo-types.agda-lib require.
7+
#
8+
# nixpkgs pinned to nixos-24.11: rustc 1.82.0 + cabal-install 3.12.1.0
9+
# (exact .tool-versions match), agda 2.7.0.1, ghc 9.6.6, just 1.38.0.
10+
#
11+
# Agda library resolution (echo-types.agda-lib: depend standard-library
12+
# absolute-zero): standard-library comes from nixpkgs (reproducible);
13+
# absolute-zero has no usable upstream package, so the local checkout at
14+
# ~/dev/repos/absolute-zero is registered via a generated AGDA libraries
15+
# file in the shellHook. Clone github.com/hyperpolymath/absolute-zero there
16+
# if missing.
17+
description = "echo-types dev shell (Agda + Haskell + Rust + just)";
18+
19+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
20+
21+
outputs = { self, nixpkgs }:
22+
let
23+
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
24+
forAllSystems = nixpkgs.lib.genAttrs systems;
25+
in {
26+
devShells = forAllSystems (system:
27+
let
28+
pkgs = import nixpkgs { inherit system; };
29+
stdlib = pkgs.agdaPackages.standard-library;
30+
in {
31+
default = pkgs.mkShell {
32+
name = "echo-types";
33+
packages = [
34+
pkgs.agda
35+
pkgs.just
36+
pkgs.ghc
37+
pkgs.cabal-install
38+
pkgs.rustc
39+
pkgs.cargo
40+
pkgs.rustfmt
41+
pkgs.clippy
42+
];
43+
shellHook = ''
44+
# Agda library file: nixpkgs standard-library (reproducible) +
45+
# local absolute-zero checkout (no usable upstream package).
46+
export AGDA_DIR="$PWD/.agda"
47+
mkdir -p "$AGDA_DIR"
48+
_stdlib_agdalib="$(echo ${stdlib}/*.agda-lib)"
49+
_az="$HOME/dev/repos/absolute-zero/absolute-zero.agda-lib"
50+
{
51+
echo "$_stdlib_agdalib"
52+
[ -f "$_az" ] && echo "$_az"
53+
} > "$AGDA_DIR/libraries"
54+
55+
echo "echo-types devShell ready"
56+
command -v agda >/dev/null && echo " agda : $(agda --version 2>/dev/null | head -n1)"
57+
command -v just >/dev/null && echo " just : $(just --version 2>/dev/null)"
58+
command -v rustc >/dev/null && echo " rustc: $(rustc --version 2>/dev/null)"
59+
command -v cabal >/dev/null && echo " cabal: $(cabal --version 2>/dev/null | head -n1)"
60+
if [ -f "$_az" ]; then
61+
echo " agda libs: standard-library + absolute-zero (local)"
62+
else
63+
echo " WARNING: absolute-zero NOT found at $_az" >&2
64+
echo " clone github.com/hyperpolymath/absolute-zero into ~/dev/repos" >&2
65+
echo " agda libs: standard-library only (absolute-zero MISSING)"
66+
fi
67+
'';
68+
};
69+
});
70+
};
71+
}

0 commit comments

Comments
 (0)