Skip to content

flavours: add module#2165

Closed
Misterio77 wants to merge 10 commits intonix-community:masterfrom
Misterio77:master
Closed

flavours: add module#2165
Misterio77 wants to merge 10 commits intonix-community:masterfrom
Misterio77:master

Conversation

@Misterio77
Copy link
Copy Markdown
Member

Description

flavours is a base16 manager. It allows you to instantly theme any supported configuration file (using base16 templates) with more than 180 existing base16 schemes, or even generate these from images.

Please let me know if there's anything missing, i'm still learning about Home Manager and Nix :D

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all.

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

    • Added myself and the module files to .github/CODEOWNERS.

@Misterio77 Misterio77 requested a review from rycee as a code owner July 7, 2021 16:00
Copy link
Copy Markdown
Contributor

@sumnerevans sumnerevans left a comment

Choose a reason for hiding this comment

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

Looks great overall. Just a small comment. Also, this needs an entry in modules/misc/news.nix.

Comment thread modules/programs/flavours.nix Outdated
Misterio77 and others added 2 commits July 7, 2021 21:57
Co-authored-by: Sumner Evans <me@sumnerevans.com>
@Misterio77 Misterio77 requested a review from sumnerevans July 8, 2021 01:01
Copy link
Copy Markdown
Contributor

@sumnerevans sumnerevans left a comment

Choose a reason for hiding this comment

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

sorry, one more thing

Comment thread modules/programs/flavours.nix Outdated
Co-authored-by: Sumner Evans <me@sumnerevans.com>
@Misterio77 Misterio77 requested a review from sumnerevans July 8, 2021 02:44
@berbiche
Copy link
Copy Markdown
Member

berbiche commented Jul 8, 2021

Would it be possible/make sense to generate the configuration during the build as opposed to the runtime?

The generated configuration would then be part of the config and be reproducible.

If so, it could be enabled with an option.

@Misterio77
Copy link
Copy Markdown
Member Author

Misterio77 commented Jul 8, 2021

I might be wrong, but don't all home-manager modules work that way? I mean, the derivations are evaluated (thus, the configs are generated) when the system is built? I'm doing it the standard way, i think.

Still wrapping my head around it all, so any examples or docs to take a look at would be of great help!

@sumnerevans sumnerevans requested a review from berbiche July 8, 2021 23:10
@Misterio77
Copy link
Copy Markdown
Member Author

Misterio77 commented Jul 11, 2021

Would it be possible/make sense to generate the configuration during the build as opposed to the runtime?

Oh i get it now. You mean the applications flavours is theming, not flavours itself, right?

Yeah, flavours is a little stateful, i think. It does work nicely when you theme a mutable config and import it in your immutable one, for example.

I'm actually porting my config to use some of the ideias from #361 right now, but still needs some work before it gets as seamless as flavours. The main one being getting onChange working on more applications.

I'm hacking at these right now:

I think i might close this PR and focus on this approach, instead.

@berbiche
Copy link
Copy Markdown
Member

Sorry, I forgot to reply.

There are multiple modules (neovim, xmonad, etc.) generating additional configuration during the build and linking files to the appropriate place (e.g. setting home.file).

What I was asking was whether Flavors could generate its configuration files for the different programs while evaluating the HM configuration.

The advantage of doing so would be reproducibility (as long as Flavors is reproducible) and caching of the built configuration (the derivation building the config files).

@Misterio77
Copy link
Copy Markdown
Member Author

Misterio77 commented Jul 11, 2021

No problems!

Everything flavours actually does is writing stuff to files in-place, so i think it won't play nicely with the setups most people using home-manager usually have. Replacing colors at build time with home-manager actually makes flavours obsolete haha.

I'm theming stuff with home manager now (here's an example), i think i'll work on getting more apps to support onChange, as that will help get all of flavours benefits without having mutable configs

@berbiche
Copy link
Copy Markdown
Member

@berbiche berbiche mentioned this pull request May 9, 2022
7 tasks
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.

5 participants