nixpkgs/pkgs/data/themes/fluent-gtk-theme/default.nix

78 lines
2.0 KiB
Nix
Raw Normal View History

2022-12-18 12:56:50 +00:00
{ lib
, stdenvNoCC
, fetchFromGitHub
, gitUpdater
, gnome-themes-extra
, gtk-engine-murrine
, jdupes
, sassc
, themeVariants ? [] # default: blue
, colorVariants ? [] # default: all
, sizeVariants ? [] # default: standard
, tweaks ? []
}:
let
pname = "fluent-gtk-theme";
in
lib.checkListOfEnum "${pname}: theme variants" [ "default" "purple" "pink" "red" "orange" "yellow" "green" "teal" "grey" "all" ] themeVariants
lib.checkListOfEnum "${pname}: color variants" [ "standard" "light" "dark" ] colorVariants
lib.checkListOfEnum "${pname}: size variants" [ "standard" "compact" ] sizeVariants
lib.checkListOfEnum "${pname}: tweaks" [ "solid" "float" "round" "blur" "noborder" "square" ] tweaks
stdenvNoCC.mkDerivation rec {
inherit pname;
version = "2023-06-20";
2022-12-18 12:56:50 +00:00
src = fetchFromGitHub {
owner = "vinceliuice";
repo = pname;
rev = version;
hash = "sha256-hUXlzLdcWeOHEJx3+vCMpxvJst6Rr8ISvlzlsUgCrhg=";
2022-12-18 12:56:50 +00:00
};
nativeBuildInputs = [
jdupes
sassc
];
buildInputs = [
gnome-themes-extra
];
propagatedUserEnvPkgs = [
gtk-engine-murrine
];
postPatch = ''
patchShebangs install.sh
'';
installPhase = ''
runHook preInstall
name= HOME="$TMPDIR" ./install.sh \
${lib.optionalString (themeVariants != []) "--theme " + builtins.toString themeVariants} \
${lib.optionalString (colorVariants != []) "--color " + builtins.toString colorVariants} \
${lib.optionalString (sizeVariants != []) "--size " + builtins.toString sizeVariants} \
${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \
--icon nixos \
2022-12-18 12:56:50 +00:00
--dest $out/share/themes
jdupes --quiet --link-soft --recurse $out/share
runHook postInstall
'';
passthru.updateScript = gitUpdater { };
meta = with lib; {
description = "Fluent design gtk theme";
homepage = "https://github.com/vinceliuice/Fluent-gtk-theme";
license = licenses.gpl3Only;
platforms = platforms.unix;
maintainers = [ maintainers.romildo ];
};
}