- Flag
- Env var
- CWD
- User-global
- End-to-end CLI tests
- ruff, mypy, poetry build, Nix build
- ruff, mypy, pytest, poetry build, poetry publish (if tagged), Nix build
- Instead of baking in the user’s packages into the flake, we should have the flake read the TOML.
- This means the user can modify the flake more. As long as they keep the lines that read the TOML and the sources (which have to be baked in), they can change the rest.
- This also means one source of truth.
IN-PROGRESS [#A] Separate the concept of sources from concept of packages in CLI, API, and storage (TOML) layers
- [x] NixPackages(attribute_path: str, source: NixSource)
- [x] NixSource(url: str, version: str)
- [ ] CLI for manipulating sources
- zilch source list
- zilch source add <source_alias> <URL> [position {first, last, <int>}] [source_version]
- zilch source remove <source_alias>
- zilch source upgrade <source_alias>
- zilch source swap <i> <j> (use zilch list to get an ordered list of sources)
- See the idea to have a TUI later on, which would be the more user friendly way of manipulating the list. But we should still have a scriptable non-TUI way of doing that.
- [ ] CLI for manipulating packages
- zilch install <package_name> –source <source_alias> (no –source given means first source containing the package)
- zilch remove <package_name> –source <source_alias> (no –source given means all sources)
- zilch upgrade [package_names …] –source <source_alias> (no –source means their current source)
- zilch search <terms> –source <source_alias> (no –source given means all sources)
- Put versions in nix list
- Show installed packages
- Upgrade selected packages or source
- Should modify-in-place flake.lock, if it exists. That way sources the user adds manually to the nix flake won’t get clobbered.
- Creates zilch.toml with empty sources and packages section
- Update documentation to match what we actually built
- Explain why we built it that way
- Explain installation process
- [ ] Install Nix, if they don’t have it already
- [ ] Ask if they want admin system-level, admin user-level, or user-level (and help them figure it out)
- [ ] Enable flakes and experimental
- [ ] Install direnv or asdf
- [ ] Install Zilch
- [ ] Install current Zilch project
- [ ] Append to .bashrc/.bash_profile.
- [ ] Print instructions to modify current shell
- [ ] Should be usable from shebang?
- Invoke zilch
- Gets the possible operations
- Fuzzy searching, validation, and good completion on each of the options
- Drop the user into a directory with the source code, the Nix recipe, the Nix flake/lock, and helper scripts.
- `⋅/package`
- Compute current diff > user-modifications.patch
- Put `patches = [ … ./user-modifications.patch ]` in Nix recipe
- `./upload`
- Prompt the user for what kind of public storage service (GitHub, …) they want to use.
- Upload patches, Nix recipe, Nix flake/lock, other files to that storage service or ask the user to.
- Test `nix build remote#package`
- `⋅/package`
- Have a ZILCH_PATH, which defaults to $XDG_CONFIG_HOME/zilch/
- Have a –path which overrides ZILCH_PATH
Zilch should have a direnv layout. The user should just `direnv allow $DIR`, and their dir becomes zilched.
- See “Getting old versions” in DESIGN.md
- Consider case where they want Python 3.12, and there is a package called python312 in the current version of their source. We only need to match that to a package named python312. However the naming is not consistent (c.f. gcc9).
- Otherwise, use older version of the source
- Note that this is dispreferred since runtime deps may conflict
- Consider using only those commits which touch the file `git rev-list nixos-unstable – pkgs/applications/editors/neovim/default.nix`
- Consider using binary search
- Consider using `nix search repo/?rev=foo` instead of `nix-env -qaP –json -f`
- TeXLive
- Python
- Ruby
- Perl
- JavaScript
- https://discourse.nixos.org/t/1000-instances-of-nixpkgs/17347
- `inputs.source.nixpkgs.follows = “nixpkgs”;`, basically
- zilch activate?
- zilch search?
- Resource path (for cached attrs) should still be hidden
https://nixos.wiki/wiki/Python
- Disable checks?
- https://nixos.org/manual/nixpkgs/stable/#reference search “How to enable interpreter optimizations?”
- https://nixos.wiki/wiki/Build_flags
- Allow unfree
- Allow broken
- Parallelism
- Print build logs
- Enable/disable Nix output manager
- Sources
- Reordable list of sources with insert and remove
- Packages
- I to install package
- search by keywords
- Prompt for source, defaults to source=Nixpkgs
- Prompts for version, defaults to version=${latest}
- D to remove a package
- U to upgrade a package
- Defaults to version=${latest}
- I to install package
- Compare to alternatives
- Review Nathan’s copy-edit PR
- Explain “Declarative package management”
- Explain why Zilch stores the result in a resource directory
- Pure Nix (not flake)?
- Home-manager module?
- NixOS module?
- Consider case where Nix fails due to no internet connection, lack of disk space, package not exists, syntax errors
- Absorb general errors with subprocess
- Source aliases should be valid Nix identifiers (and not reserved by Zilch)
- Source URLs should be URLs
- Zilch try to remove package path if it is not used by other gcroots
If they ask for python311Packages.foo and then python312Packages.bar, emit warning.