diff options
author | isabel <isabel@isabelroses.com> | 2024-06-10 14:15:52 +0100 |
---|---|---|
committer | isabel <isabel@isabelroses.com> | 2024-06-10 14:16:25 +0100 |
commit | f91c4d43eaad88736dd27c3fe2c69cb6e43a5d92 (patch) | |
tree | 613c03b258eef45dc357f091a3a3822f1a5b4d01 /pkgs/by-name/ca | |
parent | 3369c121872617068a879fad42bf5ba25f16c645 (diff) |
catppuccin-gtk: 0.7.5 -> 1.0.3
Diffstat (limited to 'pkgs/by-name/ca')
-rw-r--r-- | pkgs/by-name/ca/catppuccin-gtk/package.nix | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/pkgs/by-name/ca/catppuccin-gtk/package.nix b/pkgs/by-name/ca/catppuccin-gtk/package.nix new file mode 100644 index 0000000000000..5bc1ffbcecaba --- /dev/null +++ b/pkgs/by-name/ca/catppuccin-gtk/package.nix @@ -0,0 +1,81 @@ +{ lib +, stdenvNoCC +, fetchFromGitHub +, gtk3 +, git +, colloid-gtk-theme +, python3 +, sassc +, nix-update-script +, accents ? [ "blue" ] +, size ? "standard" +, tweaks ? [ ] +, variant ? "frappe" +}: +let + validAccents = [ "blue" "flamingo" "green" "lavender" "maroon" "mauve" "peach" "pink" "red" "rosewater" "sapphire" "sky" "teal" "yellow" ]; + validSizes = [ "standard" "compact" ]; + validTweaks = [ "black" "rimless" "normal" "float" ]; + validVariants = [ "latte" "frappe" "macchiato" "mocha" ]; + + pname = "catppuccin-gtk"; + version = "1.0.3"; +in + +lib.checkListOfEnum "${pname}: theme accent" validAccents accents +lib.checkListOfEnum "${pname}: color variant" validVariants [variant] +lib.checkListOfEnum "${pname}: size variant" validSizes [size] +lib.checkListOfEnum "${pname}: tweaks" validTweaks tweaks + +stdenvNoCC.mkDerivation { + inherit pname version; + + src = fetchFromGitHub { + owner = "catppuccin"; + repo = "gtk"; + rev = "v${version}"; + hash = "sha256-8KyZtZqVVz5UKuGdLrUsR2djD3nsJDliHMtvFtUVim8="; + }; + + nativeBuildInputs = [ + gtk3 + sassc + # git is needed here since "git apply" is being used for patches + # see <https://github.com/catppuccin/gtk/blob/4173b70b910bbb3a42ef0e329b3e98d53cef3350/build.py#L465> + git + (python3.withPackages (ps: [ ps.catppuccin ])) + ]; + + postUnpack = '' + rm -rf source/sources/colloid + cp -r ${colloid-gtk-theme.src} source/sources/colloid + chmod -R +w source/sources/colloid + ''; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/themes + + python3 build.py ${variant} \ + --accent ${builtins.toString accents} \ + ${lib.optionalString (size != [ ]) "--size " + size} \ + ${lib.optionalString (tweaks != [ ]) "--tweaks " + builtins.toString tweaks} \ + --dest $out/share/themes + + runHook postInstall + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Soothing pastel theme for GTK"; + homepage = "https://github.com/catppuccin/gtk"; + license = lib.licenses.gpl3Plus; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ fufexan dixslyf isabelroses ]; + }; +} |