2 unstable releases
Uses new Rust 2024
| 0.2.0 | Jan 2, 2026 |
|---|---|
| 0.1.0 | Nov 29, 2025 |
#358 in Filesystem
25KB
568 lines
íqán
Helps you sync Nix flake pins, so you don't end up carrying fifty ever-so-slightly different Nixpkgs in your store.
Has two modes of operation:
-
Plan mode. You give it a JSON file which looks like this:
{ "source": "/Users/kivikakk/g/vyx", "targets": { "/Users/kivikakk/g/a1d": ["nixpkgs", "fenix"], "/Users/kivikakk/g/chog": {"nixpkgs-erlang": "nixpkgs"}, "/Users/kivikakk/g/cmark-gfm-hs": ["nixpkgs"], "/Users/kivikakk/g/comrak": ["nixpkgs", "fenix"], "/Users/kivikakk/g/iqan": ["nixpkgs", "fenix"], "/Users/kivikakk/g/kivikakk": ["nixpkgs"], "/Users/kivikakk/g/koino": ["nixpkgs"], "/Users/kivikakk/g/kv": {"nixpkgs-erlang": "nixpkgs", "fenix": true}, "/Users/kivikakk/g/nossa": {"nixpkgs-erlang": "nixpkgs", "fenix": true}, "/Users/kivikakk/g/notes": ["nixpkgs"], "/Users/kivikakk/g/tahetriiv": ["nixpkgs", "fenix"] } }íqán proceeds through each target, and compares the named inputs to those in the source. The inputs can be a list, which means inputs have the same name in both source and target, or a map of input names in source to target (or
true, as a shorthand for the same).Note that "original mismatches" --- where the input specifications are different, not just the locked version --- are detected, and can be resolved in
flake.nixas well as your lock file.íqán prompts you before making any change to anything, and only modifies
flake.lockfiles specified in yourplan.json'stargetssection, andflake.nixfiles likewise located when an original mismatch occurs.flake.lockchanges are made by parsing and writing out the JSON, and minor formatting changes may occur.flake.nixchanges are made by parsing with rnix, locating the syntax node corresponding to the input being changed, and then replacing just that text span in the source. The changes are made conservatively, matching the expected existing value (as calculated fromflake.lock), and if íqán cannot be sure of what it's doing, it aborts and lets you handle it. -
One-shot mode. You run íqán in the target flake's directory, and give the directory of the source. It'll run on all inputs in the target, prompting you as above.
install
cargo install iqan will do, or cargo build --release from source.
The Nix flake will build it for you, if you like.
license
Copyright © 2025–2026 Asherah Connor <ashe@kivikakk.ee>
This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details.
Dependencies
~2.9–4MB
~75K SLoC