2023-02-16 04:20:10 +01:00
|
|
|
{ lib
|
2023-10-26 13:00:10 +02:00
|
|
|
, callPackage
|
|
|
|
, runCommand
|
2023-02-16 04:20:10 +01:00
|
|
|
, gtk-engine-murrine
|
2023-10-26 13:00:10 +02:00
|
|
|
, gnome-themes-extra
|
2023-02-16 04:20:10 +01:00
|
|
|
}:
|
|
|
|
|
2023-10-26 13:00:10 +02:00
|
|
|
let
|
2024-01-28 23:01:54 +01:00
|
|
|
prefix = "tokyonight-gtk-theme";
|
2023-02-16 04:20:10 +01:00
|
|
|
|
2023-10-26 13:00:10 +02:00
|
|
|
packages = lib.mapAttrs' (type: content: {
|
|
|
|
name = type;
|
2023-02-16 04:20:10 +01:00
|
|
|
|
2023-10-26 13:00:10 +02:00
|
|
|
value = lib.mapAttrs' (variantName: variant: {
|
|
|
|
name = variantName;
|
|
|
|
value = callPackage ./generic.nix { inherit prefix type variantName variant; };
|
|
|
|
}) content;
|
|
|
|
}) (lib.importJSON ./variants.json);
|
|
|
|
in packages // {
|
|
|
|
# Not using `symlinkJoin` because it's massively inefficient in this case
|
|
|
|
full = runCommand "${prefix}_full" {
|
|
|
|
preferLocalBuild = true;
|
2023-02-16 04:20:10 +01:00
|
|
|
|
2023-10-26 13:00:10 +02:00
|
|
|
propagatedUserEnvPkgs = [
|
|
|
|
gtk-engine-murrine
|
|
|
|
gnome-themes-extra
|
|
|
|
];
|
|
|
|
} ''
|
|
|
|
mkdir -p $out/share/{icons,themes,${prefix}}
|
2023-02-16 04:20:10 +01:00
|
|
|
|
2023-10-26 13:00:10 +02:00
|
|
|
${lib.concatStrings (lib.forEach (lib.attrValues (lib.attrsets.mergeAttrsList (lib.attrValues packages))) (variant:
|
|
|
|
''
|
|
|
|
ln -s ${variant}/share/${variant.ptype}/Tokyonight-${variant.pvariant} $out/share/${variant.ptype}/Tokyonight-${variant.pvariant}
|
|
|
|
ln -s ${variant}/share/${prefix}/LICENSE $out/share/${prefix}/LICENSE 2>/dev/null || true
|
|
|
|
''
|
|
|
|
))}
|
2023-02-16 04:20:10 +01:00
|
|
|
'';
|
|
|
|
}
|