depot/pkgs/by-name/fl/fluent-gtk-theme/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

114 lines
2.4 KiB
Nix

{
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
(finalAttrs: {
inherit pname;
version = "2024-06-12";
src = fetchFromGitHub {
owner = "vinceliuice";
repo = "fluent-gtk-theme";
rev = finalAttrs.version;
hash = "sha256-ONhW68UUrFiv5hxkR7XI8U/5+qM+tYLIS2OM05pqJi0=";
};
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 \
--dest $out/share/themes
jdupes --quiet --link-soft --recurse $out/share
runHook postInstall
'';
passthru.updateScript = gitUpdater { };
meta = {
description = "Fluent design gtk theme";
changelog = "https://github.com/vinceliuice/Fluent-gtk-theme/releases/tag/${finalAttrs.version}";
homepage = "https://github.com/vinceliuice/Fluent-gtk-theme";
license = lib.licenses.gpl3Only;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [
luftmensch-luftmensch
romildo
];
};
})