From bb7459539cd053f737bb43eea3bb58ebdbc653fa Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Sun, 30 Aug 2026 22:47:44 -0500 Subject: [PATCH] stop asking nixpkgs for its deprecated `system` attribute Every `nix develop` printed evaluation warning: 'system' has been renamed to/replaced by 'stdenv.hostPlatform.system' because the default shell was defined by looking itself up again through `self.devShells.${pkgs.system}`. Binding the shell once and using it for both attributes removes the lookup rather than spelling the attribute its new way, so there is nothing left to deprecate. No change to what the shell contains; the diff is the `let` and the reindentation it forces. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_016L2s7eybUKmuZsAXo9Rt8f --- flake.nix | 80 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/flake.nix b/flake.nix index 15cf92a..b6d27f4 100644 --- a/flake.nix +++ b/flake.nix @@ -31,43 +31,49 @@ ); in { - devShells = forAllSystems (pkgs: { - zig_0_16 = pkgs.mkShell { - name = "zig-datetime-0.16"; - nativeBuildInputs = [ - pkgs.zig_0_16 - pkgs.pinact - # Used by tools/update-tzdata.sh and by the Forgejo workflow - # that runs it. Named here rather than relied on from the - # ambient environment, so a CI runner gets the same set. - pkgs.cacert - pkgs.curl - pkgs.git - pkgs.jq - # Publishes the API documentation to ocj.page; see - # .forgejo/workflows/test.yaml. - pkgs.git-pages-cli - ]; + devShells = forAllSystems ( + pkgs: + let + zig_0_16 = pkgs.mkShell { + name = "zig-datetime-0.16"; + nativeBuildInputs = [ + pkgs.zig_0_16 + pkgs.pinact + # Used by tools/update-tzdata.sh and by the Forgejo workflow + # that runs it. Named here rather than relied on from the + # ambient environment, so a CI runner gets the same set. + pkgs.cacert + pkgs.curl + pkgs.git + pkgs.jq + # Publishes the API documentation to ocj.page; see + # .forgejo/workflows/test.yaml. + pkgs.git-pages-cli + ]; - # Naming cacert above only puts it in the closure; curl still - # has to be told where the bundle is, so that the shell does not - # depend on the surrounding system having said so. - # - # This does nothing for `zig fetch`, whose trust store is a - # hardcoded list of system paths that no environment variable - # can redirect. tools/update-tzdata.sh works around that by - # downloading with curl and hashing the local file. - # - # It has to be the shellHook rather than a plain attribute: - # `nix develop` manages the certificate variables itself and - # overwrites an attribute of the same name, but the hook runs - # afterwards and wins. - shellHook = '' - export SSL_CERT_FILE="${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" - export NIX_SSL_CERT_FILE="$SSL_CERT_FILE" - ''; - }; - default = self.devShells.${pkgs.system}.zig_0_16; - }); + # Naming cacert above only puts it in the closure; curl still + # has to be told where the bundle is, so that the shell does not + # depend on the surrounding system having said so. + # + # This does nothing for `zig fetch`, whose trust store is a + # hardcoded list of system paths that no environment variable + # can redirect. tools/update-tzdata.sh works around that by + # downloading with curl and hashing the local file. + # + # It has to be the shellHook rather than a plain attribute: + # `nix develop` manages the certificate variables itself and + # overwrites an attribute of the same name, but the hook runs + # afterwards and wins. + shellHook = '' + export SSL_CERT_FILE="${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" + export NIX_SSL_CERT_FILE="$SSL_CERT_FILE" + ''; + }; + in + { + inherit zig_0_16; + default = zig_0_16; + } + ); }; } -- knotmirror 0.0.1