2021-04-22 02:08:21 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, fetchFromGitHub
|
|
|
|
, gtk3
|
|
|
|
, gnome-themes-extra
|
|
|
|
, gtk-engine-murrine
|
|
|
|
, sassc
|
2022-09-30 11:47:45 +00:00
|
|
|
, border-radius ? null # Suggested: 2 < value < 16
|
2023-03-08 16:32:21 +00:00
|
|
|
, tweaks ? [ ] # can be "solid" "compact" "black" "primary" "macos" "submenu" "nord|dracula"
|
2022-01-25 03:21:06 +00:00
|
|
|
, withWallpapers ? false
|
2021-04-22 02:08:21 +00:00
|
|
|
}:
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
let
|
2023-03-08 16:32:21 +00: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}
|
|
|
|
'';
|
2021-12-19 01:06:50 +00:00
|
|
|
in
|
2023-03-08 16:32:21 +00:00
|
|
|
|
|
|
|
assert nordXorDracula;
|
|
|
|
lib.checkListOfEnum "${pname}: theme tweaks" validTweaks tweaks
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation
|
|
|
|
rec {
|
2023-03-08 16:32:21 +00:00
|
|
|
inherit pname;
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2023-10-20";
|
2021-02-22 21:28:39 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "Orchis-theme";
|
|
|
|
owner = "vinceliuice";
|
|
|
|
rev = version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-GhSzTtbuvbAuXxKNm29sJX5kXE2s2jMDB6Ww6Q7GNSo=";
|
2021-02-22 21:28:39 +00:00
|
|
|
};
|
|
|
|
|
2021-04-22 02:08:21 +00:00
|
|
|
nativeBuildInputs = [ gtk3 sassc ];
|
2021-02-22 21:28:39 +00:00
|
|
|
|
|
|
|
buildInputs = [ gnome-themes-extra ];
|
|
|
|
|
|
|
|
propagatedUserEnvPkgs = [ gtk-engine-murrine ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/share/themes
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2022-09-30 11:47:45 +00:00
|
|
|
bash install.sh -d $out/share/themes -t all \
|
|
|
|
${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \
|
2023-03-24 00:07:29 +00:00
|
|
|
${lib.optionalString (border-radius != null) ("--round " + builtins.toString border-radius + "px")}
|
2022-01-25 03:21:06 +00:00
|
|
|
${lib.optionalString withWallpapers ''
|
|
|
|
mkdir -p $out/share/backgrounds
|
|
|
|
cp src/wallpaper/{1080p,2k,4k}.jpg $out/share/backgrounds
|
|
|
|
''}
|
2021-02-22 21:28:39 +00: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 ];
|
|
|
|
};
|
|
|
|
}
|