nixpkgs/pkgs/data/themes/orchis-theme/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.8 KiB
Nix
Raw Normal View History

2021-04-21 17:37:27 +02:00
{ lib
, stdenvNoCC
, fetchFromGitHub
, gtk3
, gnome-themes-extra
, gtk-engine-murrine
, sassc
, border-radius ? null # Suggested: 2 < value < 16
2023-01-14 18:24:41 +01:00
, tweaks ? [ ] # can be "solid" "compact" "black" "primary" "macos" "submenu" "nord|dracula"
, withWallpapers ? false
2021-04-21 17:37:27 +02:00
}:
let
2023-01-14 18:24:41 +01:00
pname = "orchis-theme";
validTweaks = [ "solid" "compact" "black" "primary" "macos" "submenu" "nord" "dracula" ];
nordXorDracula = with builtins; lib.assertMsg (!(elem "nord" tweaks) || !(elem "dracula" tweaks)) ''
${pname}: dracula and nord cannot be mixed. Tweaks ${toString tweaks}
'';
in
2023-01-14 18:24:41 +01:00
assert nordXorDracula;
lib.checkListOfEnum "${pname}: theme tweaks" validTweaks tweaks
stdenvNoCC.mkDerivation
rec {
2023-01-14 18:24:41 +01:00
inherit pname;
2023-05-01 17:26:13 +02:00
version = "2023-04-08";
2021-01-30 21:20:34 +01:00
src = fetchFromGitHub {
repo = "Orchis-theme";
owner = "vinceliuice";
rev = version;
2023-05-01 17:26:13 +02:00
hash = "sha256-/X4Hr2M/7pf6JxTUvPoG5VkQd+rweEPeTNe9glSLh78=";
2021-01-30 21:20:34 +01:00
};
2021-04-21 17:37:27 +02:00
nativeBuildInputs = [ gtk3 sassc ];
2021-01-30 21:20:34 +01:00
buildInputs = [ gnome-themes-extra ];
propagatedUserEnvPkgs = [ gtk-engine-murrine ];
preInstall = ''
mkdir -p $out/share/themes
'';
installPhase = ''
runHook preInstall
bash install.sh -d $out/share/themes -t all \
${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \
${lib.optionalString (border-radius != null) ("--round " + builtins.toString border-radius + "px")}
${lib.optionalString withWallpapers ''
mkdir -p $out/share/backgrounds
cp src/wallpaper/{1080p,2k,4k}.jpg $out/share/backgrounds
''}
2021-01-30 21:20:34 +01:00
runHook postInstall
'';
meta = with lib; {
description = "A Material Design theme for GNOME/GTK based desktop environments.";
homepage = "https://github.com/vinceliuice/Orchis-theme";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = [ maintainers.fufexan ];
};
}