home-manager icon indicating copy to clipboard operation
home-manager copied to clipboard

alacritty: add `theme` option

Open nbraud opened this issue 10 months ago • 6 comments

Description

Add program.alacritty.theme option, to import a theme from the alacritty-theme repository.

I've been using something similar in my config repo for a while, it was high time I upstreamed it. ;3

Checklist

  • [x] Change is backwards compatible.

  • [x] Code formatted with ./format.

  • [x] Code tested through nix-shell --pure tests -A run.$t for the following tests:

    • alacritty-empty-settings
    • alacritty-example-settings
    • alacritty-merging-settings
    • alacritty-toml-config
  • [ ] Test cases updated/added. See example.

  • [x] Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

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

Maintainer CC

No listed maintainer or recurrent committer. @r-vdp was the last person to edit the module.

nbraud avatar Apr 07 '24 08:04 nbraud

Interesting. I'm guessing the following fails to eval during the test, even though it is fine under the (pure) REPL:

with lib; with builtins; pipe pkgs.alacritty-theme [
  toString
  readDir
  (filterAttrs (name: type: type == "regular" && hasSuffix ".toml" name))
  attrNames
  (map (removeSuffix ".toml"))
]

The call to toString is superfluous, let's try removing it.

~~PS: That's not sufficient, should I just make the option accept any string?~~

PPS: It was only failing when evaluating type.description, and a giant enum list was unhelpful anyhow, so I replaced it with a more human-friendly description.

nbraud avatar Apr 07 '24 08:04 nbraud

Cool! I'm afk most of the day today, but I'll have a look tomorrow!

r-vdp avatar Apr 07 '24 10:04 r-vdp

Cool! I'm afk most of the day today, but I'll have a look tomorrow!

Thanks a lot, and don't worry this is not urgent at all :) I'll go and squash all the fixup commits before then.

PS: Squashed things a bit more, as it didn't make sense to leave commits where the option isn't compatible with nixpkgs 23.11

nbraud avatar Apr 07 '24 10:04 nbraud

Rebased to deal with merge conflict.

@r-vdp, do you still want to review this?

nbraud avatar Apr 21 '24 14:04 nbraud

PS: Sorry for the rebase & pfusch noise, I forgot to reformat things after fixing a small issue.

nbraud avatar Apr 21 '24 15:04 nbraud

Can this be merged, given that someone else also tested it?

nbraud avatar May 06 '24 09:05 nbraud

@rycee any chance of getting this merged?

r-vdp avatar Jul 18 '24 22:07 r-vdp