Skip to content

Latest commit

 

History

History
205 lines (159 loc) · 7.67 KB

todo.org

File metadata and controls

205 lines (159 loc) · 7.67 KB

[#A] zilch search

[#A] zilch remove

[#A] zilch install

[#A] zilch search prettiness

[#A] Project activation

  1. Flag
  2. Env var
  3. CWD
  4. User-global

[#A] Write tests

  • End-to-end CLI tests

[#A] Get a good precommit workflow

  • ruff, mypy, poetry build, Nix build

[#A] Get a good CI workflow

  • ruff, mypy, pytest, poetry build, poetry publish (if tagged), Nix build

[#A] Read zilch.toml from Flake

  • 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)

[#A] zilch activate (mutate current environment)

[#A] zilch info

  • Put versions in nix list

[#A] zilch list

  • Show installed packages

[#A] zilch upgrade

  • Upgrade selected packages or source

[#A] Zilch should pin sources with flake.lock

  • Should modify-in-place flake.lock, if it exists. That way sources the user adds manually to the nix flake won’t get clobbered.

[#A] Zilch init

  • Creates zilch.toml with empty sources and packages section

[#B] Write better documentation

  • Update documentation to match what we actually built
  • Explain why we built it that way
  • Explain installation process

[#B] Make an installer

  • [ ] 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?

[#B] Menu-driven UI

  • Invoke zilch
  • Gets the possible operations
  • Fuzzy searching, validation, and good completion on each of the options

[#B] zilch modify $package

  • 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`

[#B] Use nix registry pin to prevent constantly downloading all of nixpkgs

[#B] Zilch should work as project-local or user-local scope

  • Have a ZILCH_PATH, which defaults to $XDG_CONFIG_HOME/zilch/
  • Have a –path which overrides ZILCH_PATH

[#B] Direnv Zilch integration

Zilch should have a direnv layout. The user should just `direnv allow $DIR`, and their dir becomes zilched.

[#B] Use Nix-output-manager

[#B] Use verbose or debug flags

[#B] Support installing a specific version of a package

  • 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`

[#B] Combine package families into environments

  • TeXLive
  • Python
  • Ruby
  • Perl
  • JavaScript

[#C] Consider strategies to combat the 1000 instances of nixpkgs problem

[#C] Cache slow operations

  • zilch activate?
  • zilch search?

[#C] When no package matches, we should offer suggestions based on Levenshtein distance

[#C] Zilch should have an option to use the flake in the current directory

  • Resource path (for cached attrs) should still be hidden

[#C] Find a way for Rich to output JSON instead of UI based on isattty/cmd flag

[#C] Prompt user for arguments if they were not given

[#C] Consolidate Python environments

https://nixos.wiki/wiki/Python

[#C] Allow the user to set package override options (per package or globally)

[#C] Allow the user to set Nix options (per package or globally)

  • Allow unfree
  • Allow broken

[#C] Nix invocation options (per invocation or globally)

  • Parallelism
  • Print build logs
  • Enable/disable Nix output manager

[#C] Aptitude-like TUI

  • 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}

[#C] Improve writeup

[#C] Define cross-compilation workflow

[#C] Consider supporting multiple backends

  • Pure Nix (not flake)?
  • Home-manager module?
  • NixOS module?

[#C] Zilch search should highlight match

[#C] Wrap Nix CLI errors

  • Consider case where Nix fails due to no internet connection, lack of disk space, package not exists, syntax errors
  • Absorb general errors with subprocess

[#C] Validate user inputs

  • Source aliases should be valid Nix identifiers (and not reserved by Zilch)
  • Source URLs should be URLs

[#C] Zilch logo

[#C] Delete individual paths

  • Zilch try to remove package path if it is not used by other gcroots

[#C] Help the user get their python packages right

If they ask for python311Packages.foo and then python312Packages.bar, emit warning.