danth/stylix

specialisations inherit the parents lib attrset

Opened this issue · 2 comments

I originally though this was an issue with rgb values being incorrect for a generated scheme.
I realized after that home-manager specialisations don't have the proper overwritting capabilities.

when I set a wallpaper to a default:

# I need to do this to avoid "stylix.image used but not defined" Error
stylix.enable = lib.mkDefault false;
stylix.image = lib.mkDefault defaulttheme.stylix.image; # grabbed with pkgs.fetchurl

my specialisation inherits the main generated values:

specialisation.guiDefault.configuration = lib.mkMerge [ theme Dark { stylix.enable = true;}];
  theme = { stylix.image = pkgs.fetchurl {
    url = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    sha256 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; }; };

The specialisation seems to inherit the parent's config.lib.stylix attrset.
the same issue persists when I use a mustache template that mimics the code I used.
I will work on a proof of concept on this issue and link it here.

https://github.com/kr-nn/stylix-poc

Linked repo is the POC

I also noticed during creating this POC that there is odd behavior.
The specialisations seem to have appended output from the parent.
I noticed files contain the info like so:

./generated_color_map_file.md:

%parent_generated_content%
...
%child_generated_content%

This is an example of the color map file I generated in a specialisation:
notice that the specialisation is appended below the parent.

[HEX]
base00=3d3d3d
base01=3d3d3d
base02=3d3d3d
base03=3d3d3d
base04=3d3d3d
base05=151515
base06=151515
base07=151515
base08=3d3d3d
base09=3d3d3d
base0A=3d3d3d
base0B=3d3d3d
base0C=3d3d3d
base0D=3d3d3d
base0E=3d3d3d
base0F=3d3d3d
[RGB]
base00=61 | 61 | 61
base01=61 | 61 | 61
base02=61 | 61 | 61
base03=61 | 61 | 61
base04=61 | 61 | 61
base05=21 | 21 | 21
base06=21 | 21 | 21
base07=21 | 21 | 21
base08=61 | 61 | 61
base09=61 | 61 | 61
base0A=61 | 61 | 61
base0B=61 | 61 | 61
base0C=61 | 61 | 61
base0D=61 | 61 | 61
base0E=61 | 61 | 61
base0F=61 | 61 | 61
[normal]
base00=3d3d3d
base01=3d3d3d
base02=3d3d3d
base03=3d3d3d
base04=3d3d3d
base05=151515
base06=151515
base07=151515
base08=3d3d3d
base09=3d3d3d
base0A=3d3d3d
base0B=3d3d3d
base0C=3d3d3d
base0D=3d3d3d
base0E=3d3d3d
base0F=3d3d3d
[HEX]
base00=2d9280
base01=508c84
base02=218d80
base03=145c58
base04=1a404b
base05=101d25
base06=001415
base07=001415
base08=176a58
base09=1d6774
base0A=13686f
base0B=2f666d
base0C=196968
base0D=316767
base0E=466369
base0F=2c6578
[RGB]
base00=45 | 146 | 128
base01=80 | 140 | 132
base02=33 | 141 | 128
base03=20 | 92 | 88
base04=26 | 64 | 75
base05=16 | 29 | 37
base06=0 | 20 | 21
base07=0 | 20 | 21
base08=23 | 106 | 88
base09=29 | 103 | 116
base0A=19 | 104 | 111
base0B=47 | 102 | 109
base0C=25 | 105 | 104
base0D=49 | 103 | 103
base0E=70 | 99 | 105
base0F=44 | 101 | 120
[normal]
base00=2d9280
base01=508c84
base02=218d80
base03=145c58
base04=1a404b
base05=101d25
base06=001415
base07=001415
base08=176a58
base09=1d6774
base0A=13686f
base0B=2f666d
base0C=196968
base0D=316767
base0E=466369
base0F=2c6578%