From cb73e623a341abbd427e5781e19174d3e92b953c Mon Sep 17 00:00:00 2001 From: CristhianMotoche Date: Fri, 3 Jul 2026 10:44:30 -0500 Subject: [PATCH 1/5] Update devenv lockfile --- devenv.lock | 86 ++++++++++++++--------------------------------------- 1 file changed, 23 insertions(+), 63 deletions(-) diff --git a/devenv.lock b/devenv.lock index 083f5fb4..9f6c1c7e 100644 --- a/devenv.lock +++ b/devenv.lock @@ -3,11 +3,11 @@ "devenv": { "locked": { "dir": "src/modules", - "lastModified": 1719003735, + "lastModified": 1782305913, + "narHash": "sha256-CW+mSdVBvJ1kuuXPrx05Kmee8YZUhOQ3gI8H8roFDOY=", "owner": "cachix", "repo": "devenv", - "rev": "ffbb18da9000524978d3e537f5e02f48535d2aed", - "treeHash": "60ca1cd5b478a61ecc2ec0e454be4ff7b7c3241b", + "rev": "5f6233e19a31955435e667c20e056ae147498ecc", "type": "github" }, "original": { @@ -17,89 +17,49 @@ "type": "github" } }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1733328505, - "owner": "edolstra", - "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "git-hooks": { + "nixpkgs": { "inputs": { - "flake-compat": "flake-compat", - "gitignore": "gitignore", - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs-src": "nixpkgs-src" }, "locked": { - "lastModified": 1742649964, + "lastModified": 1782132010, + "narHash": "sha256-ZnAVHdVrotp80iIMm5CSR1fdxPlw7Uwmwxb+O/wsgZ8=", "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", + "repo": "devenv-nixpkgs", + "rev": "12866ae2dddbc0ab8b329915f8072bb9c75bde89", "type": "github" }, "original": { "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "git-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", + "ref": "rolling", + "repo": "devenv-nixpkgs", "type": "github" } }, - "nixpkgs": { + "nixpkgs-src": { + "flake": false, "locked": { - "lastModified": 1716977621, - "owner": "cachix", - "repo": "devenv-nixpkgs", - "rev": "4267e705586473d3e5c8d50299e71503f16a6fb6", - "treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412", + "lastModified": 1781607440, + "narHash": "sha256-rxO+uc/KFbSJp+pgyXRuAX6QlG9hJdnt0BXpEQRXY+U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e41b24abd260e8f71dbe2f5737d24122f972158", "type": "github" }, "original": { - "owner": "cachix", - "ref": "rolling", - "repo": "devenv-nixpkgs", + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { "devenv": "devenv", - "git-hooks": "git-hooks", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": [ - "git-hooks" - ] + "nixpkgs": "nixpkgs" } } }, "root": "root", "version": 7 -} +} \ No newline at end of file From 2e4f99c3ea4d3f828390d01e22d2be422f88406a Mon Sep 17 00:00:00 2001 From: CristhianMotoche Date: Fri, 3 Jul 2026 11:33:20 -0500 Subject: [PATCH 2/5] Pin devenv nixpkgs input --- devenv.lock | 28 ++++------------------------ devenv.yaml | 2 +- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/devenv.lock b/devenv.lock index 9f6c1c7e..a34ba2bd 100644 --- a/devenv.lock +++ b/devenv.lock @@ -18,38 +18,18 @@ } }, "nixpkgs": { - "inputs": { - "nixpkgs-src": "nixpkgs-src" - }, "locked": { - "lastModified": 1782132010, - "narHash": "sha256-ZnAVHdVrotp80iIMm5CSR1fdxPlw7Uwmwxb+O/wsgZ8=", + "lastModified": 1716977621, + "narHash": "sha256-Q1UQzYcMJH4RscmpTkjlgqQDX5yi1tZL0O345Ri6vXQ=", "owner": "cachix", "repo": "devenv-nixpkgs", - "rev": "12866ae2dddbc0ab8b329915f8072bb9c75bde89", + "rev": "4267e705586473d3e5c8d50299e71503f16a6fb6", "type": "github" }, "original": { "owner": "cachix", - "ref": "rolling", "repo": "devenv-nixpkgs", - "type": "github" - } - }, - "nixpkgs-src": { - "flake": false, - "locked": { - "lastModified": 1781607440, - "narHash": "sha256-rxO+uc/KFbSJp+pgyXRuAX6QlG9hJdnt0BXpEQRXY+U=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "3e41b24abd260e8f71dbe2f5737d24122f972158", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", + "rev": "4267e705586473d3e5c8d50299e71503f16a6fb6", "type": "github" } }, diff --git a/devenv.yaml b/devenv.yaml index 68616a49..0f49b058 100644 --- a/devenv.yaml +++ b/devenv.yaml @@ -1,4 +1,4 @@ # yaml-language-server: $schema=https://devenv.sh/devenv.schema.json inputs: nixpkgs: - url: github:cachix/devenv-nixpkgs/rolling + url: github:cachix/devenv-nixpkgs/4267e705586473d3e5c8d50299e71503f16a6fb6 From a68099994d2b34668227fadd088a6d1e59ef3a52 Mon Sep 17 00:00:00 2001 From: CristhianMotoche Date: Fri, 3 Jul 2026 14:16:00 -0500 Subject: [PATCH 3/5] Fix devenv input compatibility --- devenv.lock | 22 +++++++++++----------- devenv.yaml | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/devenv.lock b/devenv.lock index a34ba2bd..b0633ffa 100644 --- a/devenv.lock +++ b/devenv.lock @@ -3,11 +3,11 @@ "devenv": { "locked": { "dir": "src/modules", - "lastModified": 1782305913, - "narHash": "sha256-CW+mSdVBvJ1kuuXPrx05Kmee8YZUhOQ3gI8H8roFDOY=", + "lastModified": 1783049965, + "narHash": "sha256-z2QvrvE+gzLnpqfLpQA4aq2gAB4xn6C5q2o1l7GBMXU=", "owner": "cachix", "repo": "devenv", - "rev": "5f6233e19a31955435e667c20e056ae147498ecc", + "rev": "afed7bf3240c70d2827569568d2c46c25a64db51", "type": "github" }, "original": { @@ -19,17 +19,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1716977621, - "narHash": "sha256-Q1UQzYcMJH4RscmpTkjlgqQDX5yi1tZL0O345Ri6vXQ=", - "owner": "cachix", - "repo": "devenv-nixpkgs", - "rev": "4267e705586473d3e5c8d50299e71503f16a6fb6", + "lastModified": 1767313136, + "narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d", "type": "github" }, "original": { - "owner": "cachix", - "repo": "devenv-nixpkgs", - "rev": "4267e705586473d3e5c8d50299e71503f16a6fb6", + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", "type": "github" } }, diff --git a/devenv.yaml b/devenv.yaml index 0f49b058..45c51012 100644 --- a/devenv.yaml +++ b/devenv.yaml @@ -1,4 +1,4 @@ # yaml-language-server: $schema=https://devenv.sh/devenv.schema.json inputs: nixpkgs: - url: github:cachix/devenv-nixpkgs/4267e705586473d3e5c8d50299e71503f16a6fb6 + url: github:NixOS/nixpkgs/nixos-25.05 From d4c762b70afc1bb5eb3c13a7645638b65ae663ab Mon Sep 17 00:00:00 2001 From: CristhianMotoche Date: Fri, 3 Jul 2026 16:09:47 -0500 Subject: [PATCH 4/5] Use Nix GHC for stack builds --- .github/workflows/build.yml | 6 +++--- devenv.nix | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90d3a5a5..12a8c940 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}- ${{ runner.os }}-stack-global- - name: Install dependencies - run: devenv shell -- stack build --only-dependencies --test + run: devenv shell -- stack --system-ghc --no-install-ghc build --only-dependencies --test - name: Setup cache for `.stack-work` uses: actions/cache@v4 with: @@ -56,9 +56,9 @@ jobs: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}- ${{ runner.os }}-stack-work- - name: Compile code - run: devenv shell -- stack build --test --no-run-tests + run: devenv shell -- stack --system-ghc --no-install-ghc build --test --no-run-tests - name: Run tests - run: devenv shell -- stack test + run: devenv shell -- stack --system-ghc --no-install-ghc test nix-build: strategy: diff --git a/devenv.nix b/devenv.nix index 6797bd8a..89953e64 100644 --- a/devenv.nix +++ b/devenv.nix @@ -4,6 +4,7 @@ packages = [ pkgs.git + pkgs.haskell.compiler.ghc984 pkgs.stack pkgs.zsh ] From ffa6f2735ffb7ae49222ae60b51e5b453da9e663 Mon Sep 17 00:00:00 2001 From: CristhianMotoche Date: Thu, 9 Jul 2026 16:46:55 -0500 Subject: [PATCH 5/5] Let Stack manage GHC in CI --- .github/workflows/build.yml | 6 +++--- devenv.nix | 10 +++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12a8c940..90d3a5a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}- ${{ runner.os }}-stack-global- - name: Install dependencies - run: devenv shell -- stack --system-ghc --no-install-ghc build --only-dependencies --test + run: devenv shell -- stack build --only-dependencies --test - name: Setup cache for `.stack-work` uses: actions/cache@v4 with: @@ -56,9 +56,9 @@ jobs: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}- ${{ runner.os }}-stack-work- - name: Compile code - run: devenv shell -- stack --system-ghc --no-install-ghc build --test --no-run-tests + run: devenv shell -- stack build --test --no-run-tests - name: Run tests - run: devenv shell -- stack --system-ghc --no-install-ghc test + run: devenv shell -- stack test nix-build: strategy: diff --git a/devenv.nix b/devenv.nix index 89953e64..b45f6eac 100644 --- a/devenv.nix +++ b/devenv.nix @@ -4,11 +4,19 @@ packages = [ pkgs.git - pkgs.haskell.compiler.ghc984 pkgs.stack pkgs.zsh ] ++ lib.optionals pkgs.stdenv.isLinux [ pkgs.gmp ]; + + enterShell = lib.optionalString pkgs.stdenv.isDarwin '' + # Let Stack's downloaded GHC use the host Darwin toolchain/libs instead of + # inheriting Nix stdenv linker flags that can pull in incompatible libffi. + unset NIX_CFLAGS_COMPILE NIX_LDFLAGS + export CC=/usr/bin/clang + export CXX=/usr/bin/clang++ + export LD=/usr/bin/ld + ''; }