nixpkgs/pkgs/by-name/vi/vimix-gtk-themes/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

99 lines
2.3 KiB
Nix

{
lib,
stdenvNoCC,
fetchFromGitHub,
gnome-shell,
gtk-engine-murrine,
gtk_engines,
jdupes,
sassc,
gitUpdater,
themeVariants ? [ ], # default: doder (blue)
colorVariants ? [ ], # default: all
sizeVariants ? [ ], # default: standard
tweaks ? [ ],
}:
let
pname = "vimix-gtk-themes";
in
lib.checkListOfEnum "${pname}: theme variants"
[
"doder"
"beryl"
"ruby"
"amethyst"
"jade"
"grey"
"all"
]
themeVariants
lib.checkListOfEnum
"${pname}: color variants"
[ "standard" "light" "dark" ]
colorVariants
lib.checkListOfEnum
"${pname}: size variants"
[ "standard" "compact" "all" ]
sizeVariants
lib.checkListOfEnum
"${pname}: tweaks"
[ "flat" "grey" "mix" "translucent" ]
tweaks
stdenvNoCC.mkDerivation
rec {
inherit pname;
version = "2024-04-20";
src = fetchFromGitHub {
owner = "vinceliuice";
repo = pname;
rev = version;
sha256 = "RbAdoix+UWKiLB+04YiPa0UwzO1fFLy56IG1MipmE+E=";
};
nativeBuildInputs = [
gnome-shell # needed to determine the gnome-shell version
jdupes
sassc
];
buildInputs = [
gtk_engines
];
propagatedUserEnvPkgs = [
gtk-engine-murrine
];
postPatch = ''
patchShebangs install.sh
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/themes
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} \
--dest $out/share/themes
rm $out/share/themes/*/{AUTHORS,LICENSE}
jdupes --quiet --link-soft --recurse $out/share
runHook postInstall
'';
passthru.updateScript = gitUpdater { };
meta = with lib; {
description = "Flat Material Design theme for GTK based desktop environments";
homepage = "https://github.com/vinceliuice/vimix-gtk-themes";
license = licenses.gpl3Only;
platforms = platforms.unix;
maintainers = [ maintainers.romildo ];
};
}