From 2f8b47347d579d30ae43ddca015153ff0841b04f Mon Sep 17 00:00:00 2001 From: Niclas Overby Date: Mon, 17 Aug 2026 15:05:28 +0200 Subject: [PATCH] feat(flake.nix): Take nix-workspace as an input instead of carrying it The framework is developed in its own repo now, so this tree consumes it the way anyone else does rather than importing a copy of it by path. Its eleven modules come out of the same repo one at a time, each selected with ?dir=modules/. That was the point of moving it out, and it pays immediately: the two bugs it shipped last week were both ones only an input-consumer could hit, and finding them needed a mock consumer built by hand. This tree is that consumer now. The circularity that kept it here is gone with it. While the framework lived here and was published from here, taking it as an input would have meant publishing a change before this tree could evaluate that change; nothing is published from here that this tree also depends on any more. One flake per project, not two. Each names nix-workspace by URL, which is the same string in tree and in a clone, so the second copy under generated/ and the josh term that mapped it over the first are both gone. Only the lock is still generated, because a lock belongs to the published repo while this tree locks these as path inputs. input-usage now takes the inputs this flake declares from flake.lock's root node rather than from config.inputs. A module hands its pin to the consumer by setting one, so config.inputs holds names nobody declared here - and the file reading system-manager moved to nix-workspace, so grepping this tree for its reader found nothing and the check failed on an input that was never ours. statix.toml joins the other root configs: written in devshell/modules/configs and copied in on shell entry, rather than committed at the root where the ones beside it are ignored. Signed-off-by: Niclas Overby --- flake.lock | 8 ++++---- flake.nix | 15 ++++++--------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index be74c41..20d9a75 100644 --- a/flake.lock +++ b/flake.lock @@ -65,11 +65,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1786969942, - "narHash": "sha256-NkupovRJNpaVnbKVm+OJkzO+cOHg8Ga9W0V90entEZM=", + "lastModified": 1786971797, + "narHash": "sha256-5+zU3MuO7Cwb4125fhwe6Z37/lAwM3mrPYcAuXO5FBE=", "ref": "refs/heads/main", - "rev": "54d06ccb4c76c4124752a6f4139d0955f643cafa", - "revCount": 28, + "rev": "8d1a6c77150f8b46c52c8c182aff01f4c2aae6a5", + "revCount": 30, "type": "git", "url": "https://tangled.org/overby.me/nix-workspace" }, diff --git a/flake.nix b/flake.nix index 645a7e9..a6385e7 100644 --- a/flake.nix +++ b/flake.nix @@ -1,17 +1,14 @@ -# Standalone build for this project, as the monorepo sees it. Generated by +# Standalone build for the published repo. Generated by # platform/tangled/publish/gen-project.nu; edit that template, not this file. # -# nix-workspace is a path here, so the monorepo can evaluate its own change to -# it without publishing first, and so the root flake can take this as an -# input and check that it still builds. The published repo gets the same file -# with a Tangled URL, mapped over this one by josh. -# -# The relative path only resolves when this flake is reached through the repo -# root: as a root input, or `nix eval '.?dir=#...'`. +# The build, the devshell and its hooks, the formatter and the nixpkgs this +# resolves against are shared with every other repo published from the +# monorepo, and live in the nix-workspace flake. It is callable, so what is +# particular to this project is all that is left to say. { description = "A GNU diffutils-compatible suite of file comparison tools written in Rust"; - inputs.workspace.url = "path:../../../platform/nix/workspace"; + inputs.workspace.url = "git+https://tangled.org/overby.me/nix-workspace"; outputs = inputs: inputs.workspace ./. { -- 2.51.2