feat(flake): #134 — unstable.<pkg> in the downstream, one input, no hand pins
All checks were successful
Check / eval (push) Successful in 4m16s
All checks were successful
Check / eval (push) Successful in 4m16s
Nomarchy now carries a nixpkgs-unstable input and exposes it through overlays.default as an `unstable` attrset: in the template's `home.packages = with pkgs; [ … ]` a user writes `unstable.lmstudio` and is done. Downstream stays one locked input; nomarchy-pull moves it. lib.nix needed zero changes — mkFlake's pkgs already applies the overlay. The import is plain and non-recursive, so configs that never reference unstable. pay nothing beyond the input fetch; allowUnfree mirrors the base set so the motivating lmstudio resolves. Home packages are the supported surface (documented convention). Costs stated in the README, not hidden: you own the pinned+unstable combination; a second toolchain lands in your closure (~690 of ~4k paths shared, measured on lmstudio); it moves when the lock moves. Lock bumps now move two channels — VERIFICATION §5 and CONVENTIONS updated accordingly. flake.lock gained exactly one node (nixos-unstable @ 753cc8a); nothing else moved. Verification: V1 — nix flake check --no-build green; new eval-only checks.unstable-seam green (26.05pre vs 26.11pre lib.version, no builds); template HM activation built via mkFlake with unstable.hello enabled and its closure carries the unstable store path (pg2zfr… vs pinned nm7p8w…). Implementation by a Sonnet subagent; design and review on Fable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
34
flake.nix
34
flake.nix
@@ -4,6 +4,11 @@
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
||||
|
||||
# Second, newer channel — exists solely to feed the `unstable.*` overlay
|
||||
# seam (#134), so downstream can pick individual newer apps without a
|
||||
# second flake input of their own.
|
||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-26.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@@ -27,7 +32,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, stylix, nixos-hardware, ... }:
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, stylix, nixos-hardware, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
username = "nomarchy"; # reference host only; downstream picks its own
|
||||
@@ -79,6 +84,17 @@
|
||||
# the `nomarchy.stateFile` option — reading it stays pure.
|
||||
|
||||
overlays.default = final: prev: {
|
||||
# A second, newer channel for individual apps (#134) — e.g. lmstudio,
|
||||
# whose fast-moving upstream a pinned nixpkgs lags. Plain `import`,
|
||||
# deliberately NOT final-recursive: it evaluates only when a config
|
||||
# actually references `unstable.something`, so checkouts that never
|
||||
# write `unstable.` pay nothing for it. allowUnfree mirrors the base
|
||||
# set (lib.nix) so unfree apps — lmstudio is the motivating case —
|
||||
# resolve here too.
|
||||
unstable = import nixpkgs-unstable {
|
||||
inherit (prev.stdenv.hostPlatform) system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
nomarchy-state-sync = final.callPackage ./pkgs/nomarchy-state-sync {
|
||||
# Presets baked into the package, so `nomarchy-state-sync list`
|
||||
# works on machines that don't check out this repo.
|
||||
@@ -2268,6 +2284,22 @@
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
# #134: proves the `unstable.*` overlay seam exists and is really a
|
||||
# second channel, without building anything from it — evaluation-only,
|
||||
# so this stays cheap even though nixpkgs-unstable is a whole extra
|
||||
# input. `pkgs` here already carries overlays.default (line ~35).
|
||||
unstable-seam =
|
||||
let
|
||||
expect = cond: msg: nixpkgs.lib.assertMsg cond "unstable-seam: ${msg}";
|
||||
ok =
|
||||
expect (pkgs.unstable ? hello)
|
||||
"pkgs.unstable has no `hello` — the overlay attr is missing or broken"
|
||||
&& expect (pkgs.unstable.lib.version != pkgs.lib.version)
|
||||
("pkgs.unstable.lib.version == pkgs.lib.version — this is the same "
|
||||
+ "channel as the pinned nixpkgs, not a second one");
|
||||
in
|
||||
assert ok; pkgs.runCommand "nomarchy-unstable-seam" { } "touch $out";
|
||||
};
|
||||
|
||||
# ─── Reference host ────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user