From 6ed08d00a286368ad75ea73b7bf9329598133cb4 Mon Sep 17 00:00:00 2001 From: Niclas Overby Date: Sun, 16 Aug 2026 19:40:29 +0200 Subject: [PATCH] chore(platform/tangled/publish): Call nix-project instead of restating it Every published flake was three inputs, two follows, an import and a nested option block, of which one line was about the project. It is now the call and the settings: outputs = inputs: inputs.project ./. { name = "oxidized-sed"; ... }; The nixpkgs revision goes with it. It was written into all thirty-eight files to keep them building against one nixpkgs; the callable flake closes over its own inputs, so they share nixpkgs by construction and each lock has a single direct input. Signed-off-by: Niclas Overby --- flake.lock | 17 ++++++----------- flake.nix | 36 +++++++----------------------------- 2 files changed, 13 insertions(+), 40 deletions(-) diff --git a/flake.lock b/flake.lock index 4394bf6..5db9050 100644 --- a/flake.lock +++ b/flake.lock @@ -19,6 +19,7 @@ "flakelight": { "inputs": { "nixpkgs": [ + "project", "nixpkgs" ] }, @@ -76,20 +77,16 @@ }, "project": { "inputs": { - "flakelight": [ - "flakelight" - ], + "flakelight": "flakelight", "git-hooks": "git-hooks", - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1786900787, - "narHash": "sha256-kV3+bk6b33aRpKgrF+i1boz+aqLLiUigAjv9L3Ib2Uw=", + "lastModified": 1786901992, + "narHash": "sha256-GP5x5RDrpNtXGCg1EVUlWy1LtrLtLpMnuVJrErNe0G4=", "owner": "overby-me", "repo": "nix-project", - "rev": "ece63689a313f3d3fc9e9d9bf07b48237ace93bc", + "rev": "c9c59a5f8519448c10407f67417f8b9dbd26b31e", "type": "github" }, "original": { @@ -100,8 +97,6 @@ }, "root": { "inputs": { - "flakelight": "flakelight", - "nixpkgs": "nixpkgs", "project": "project" } } diff --git a/flake.nix b/flake.nix index e3131f5..d7b5365 100644 --- a/flake.nix +++ b/flake.nix @@ -1,40 +1,18 @@ # Standalone build for the published repo. Generated by # platform/tangled/publish/gen-project.nu; edit that template, not this file. # -# The build, the devshell and its hooks, and the formatter are shared with -# every other repo published from the monorepo, and live in the nix-project -# module. Only what is particular to this project is stated here. +# 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-project 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 = { - # Pinned to the same revision the monorepo resolves, so every published - # repo builds against identical nixpkgs and they cannot drift apart. - # Change it by re-running the generator, never here. - nixpkgs.url = "github:NixOS/nixpkgs/fcb8fcd6bf2d0adecae5bd491afaaaf8311b758d"; - - flakelight = { - url = "github:accelbread/flakelight"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - project = { - url = "github:overby-me/nix-project"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.flakelight.follows = "flakelight"; - }; - }; + inputs.project.url = "github:overby-me/nix-project"; outputs = inputs: - inputs.flakelight ./. { - inherit inputs; - imports = [inputs.project.flakelightModules.default]; - + inputs.project ./. { + name = "oxidized-diffutils"; description = "A GNU diffutils-compatible suite of file comparison tools written in Rust"; - - project = { - name = "oxidized-diffutils"; - root = ./.; - }; }; } -- 2.51.2