danth / stylix

System-wide colorscheming and typography for NixOS
https://stylix.danth.me/
MIT License
1.16k stars 143 forks source link

Generating themes without linking #156

Open diegofariasm opened 1 year ago

diegofariasm commented 1 year ago

I have been trying to use stylix lately and have run into the issue that home-manager makes the files immutable, tying changing your configuration to messing around home-manager.

So, instead of automatically linking everything to place, wouldn't it be possible to make the contents for the file available to the user?

Something like this:

 themeFile = lib.mkOption {
      type = lib.types.str;
      default = "";
      description = "The config for theme.";
    };

Where it could be something like the color.toml file for wezterm, for example.

That could make you able to symlink, for example, a color.toml file and just include it manually into your configuration, making the only thing stylix is responsible for generating the theme files.

dwarfmaster commented 1 year ago

It may make sense to include the themeFile option for the modules where we generate it ourselves, but for the wezterm module we use the home-manager module to set the values (and looking at the wezterm module it seems we need to add some lua to the main config file). So maybe we can support this on a best effort basis, but since we're using hm we're more or less under the assumption that we handle fully the configuration of the packages we theme.

dwarfmaster commented 1 year ago

For your specific situation I can think of two solutions:

diegofariasm commented 1 year ago

It may make sense to include the themeFile option for the modules where we generate it ourselves, but for the wezterm module we use the home-manager module to set the values (and looking at the wezterm module it seems we need to add some lua to the main config file). So maybe we can support this on a best effort basis, but since we're using hm we're more or less under the assumption that we handle fully the configuration of the packages we theme.

That does make sense. Something along those lines would likely exceed the functionality that Stylix aims to achiev

danth commented 1 year ago

It sounds like you might be better off with a standard base16 builder rather than Stylix? That would generate all of the theme files and leave them for you to put into place by hand.

diegofariasm commented 1 year ago

It sounds like you might be better off with a standard base16 builder rather than Stylix? That would generate all of the theme files and leave them for you to put into place by hand.

That's true. Although i haven't found any of them yet, it sounds just like what i need. Could you recommend me any?

danth commented 1 year ago

Flavours looks relevant and is packaged in Nixpkgs