Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starship: add option to use community presets #6155

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kpbaks
Copy link

@kpbaks kpbaks commented Nov 30, 2024

Description

Presets are community-submitted configurations for starship. See: https://starship.rs/presets/#presets.

This PR adds the option programs.starship.preset that can be set to the name of a preset. If programs.starship.preset != null it will have priority over programs.starship.settings.

The preset is fetched from starships github repo by using pkgs.fetchFromGithub. I do not think this implementation detail is ideal, as the version fetched from the repo can be out of sync with programs.starship.package. This can lead to a bad user experience where a user has seen a preset online and wants to use it, but cannot because the revision is out of date. I am not experienced enough with nix and nixpkgs to know of an alternative. You can get the TOML of the preset with starship preset <name> where <name> is one of the items in starship preset --list.

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

Presets are community-submitted configurations for starship.
See: https://starship.rs/presets/#presets
jmuchovej added a commit to jmuchovej/forked-home-manager that referenced this pull request Dec 28, 2024
Based on patch from nix-community#6155

Signed-off-by: John Muchovej <jmuchovej@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant