From 166c185ca4b08709bd1f147e74e97c53687fa175 Mon Sep 17 00:00:00 2001 From: Emile Clark-Boman Date: Tue, 27 Jan 2026 17:51:17 +1000 Subject: [PATCH] isolate ./nt and ./flake mixtures --- flake.lock | 22 +++++++++++++++++++++- flake.nix | 53 ++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 67 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index 5999137..f428ce8 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,26 @@ { "nodes": { - "root": {} + "nixpkgs": { + "locked": { + "lastModified": 1767313136, + "narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } }, "root": "root", "version": 7 diff --git a/flake.nix b/flake.nix index bef4542..3ba8c4e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,17 +1,56 @@ { description = "NixTypes (nt)"; - outputs = inputs: let + inputs = { + systems.url = "github:nix-systems/default"; + + # NOTE: nixpkgs is only used in devshells + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; + # NOTE: nix-unit is only used in checks + nix-unit = { + url = "github:nix-community/nix-unit"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { + self, + systems, + nixpkgs, + nix-unit, + }: let + # TODO: implement mix.extend and mix.isolate + inherit + (mix) + extend + # isolate + newMixture + ; + + # inputs accessible to all modules + base = { + inherit mix; + flake = self; + }; + + # flake dependencies + # NOTE: the NixTypes library has no dependencies + # NOTE: but the developer tooling (for me) does + deps = { + inherit systems nixpkgs nix-unit; + }; + # Step 1: Bootstrap and blast off (*zooommmmm whoooosshhhhh pppppeeeeeeewww*) bootstrap = import ./nt/primitives/bootstrap; # Step 2: Lie to Mix about its real identity (it's not ready for the truth...) mix = import ./nt/mix {this = bootstrap;}; in - # Step 3: Actually import NixTypes - import ./nt { - inherit mix; - flake = inputs.self; - }; - + newMixture base (mixture: { + includes.public = [ + (extend ./flake deps) + # Step 3: Actually import NixTypes + ./nt + ]; + }); # Step 4: Like and subscripe!!1!11!!!!! }