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

vivid: add module #6045

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

vivid: add module #6045

wants to merge 1 commit into from

Conversation

arunoruto
Copy link

@arunoruto arunoruto commented Nov 5, 2024

Description

Add module for https://github.com/sharkdp/vivid.
Previous PRs #2194 and #3705 addressed this, but never merged.

The themes and filetypes section were taken from #2194.
The integrations are used, since the variable name needs to be set to the output of the vivid generate <theme> command. One could utilize what #2194 used:

home.sessionVariables = mkIf (cfg.theme != null) {
    LS_COLORS = "$(${cfg.package}/bin/vivid generate ${cfg.theme})";
};

but this wouldn't be correct for fish and nushell.

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

@arunoruto
Copy link
Author

@folliehiyuki Hej, I just wanted to check if the PR is alright. It is my first in the hm repo, so feedback is always appreciated!

"set -gx LS_COLORS (${lib.getExe pkgs.vivid} generate ${theme})";
nushellLine = theme: "${lib.getExe pkgs.vivid} generate ${theme}";
zshLine = bashLine;
in {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can put a with lib; declaration here, so usages of lib afterward can be shorten.

};

theme = lib.mkOption {
type = lib.types.nullOr lib.types.str;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type = lib.types.nullOr lib.types.str;
type = with types; nullOr str;

assuming that with lib; was declared above.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same goes for the other options as well.

@folliehiyuki
Copy link

Can you also write a couple of assert tests for filetypes.yml and a sample theme file?

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.

2 participants