2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-11-21 17:40:18 +00:00
|
|
|
, gitUpdater
|
2021-06-28 23:13:55 +00:00
|
|
|
, glib
|
2021-08-05 21:33:18 +00:00
|
|
|
, gnome-shell
|
2021-06-28 23:13:55 +00:00
|
|
|
, gnome-themes-extra
|
2022-03-05 16:20:37 +00:00
|
|
|
, jdupes
|
2021-06-28 23:13:55 +00:00
|
|
|
, libxml2
|
|
|
|
, sassc
|
|
|
|
, util-linux
|
2022-03-05 16:20:37 +00:00
|
|
|
, altVariants ? [] # default: normal
|
|
|
|
, colorVariants ? [] # default: all
|
|
|
|
, opacityVariants ? [] # default: all
|
|
|
|
, themeVariants ? [] # default: default (BigSur-like theme)
|
|
|
|
, nautilusSize ? null # default: 200px
|
|
|
|
, panelOpacity ? null # default: 15%
|
|
|
|
, panelSize ? null # default: 32px
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
let
|
|
|
|
pname = "whitesur-gtk-theme";
|
|
|
|
single = x: lib.optional (x != null) x;
|
|
|
|
|
|
|
|
in
|
|
|
|
lib.checkListOfEnum "${pname}: alt variants" [ "normal" "alt" "all" ] altVariants
|
|
|
|
lib.checkListOfEnum "${pname}: color variants" [ "light" "dark" ] colorVariants
|
|
|
|
lib.checkListOfEnum "${pname}: opacity variants" [ "normal" "solid" ] opacityVariants
|
|
|
|
lib.checkListOfEnum "${pname}: theme variants" [ "default" "blue" "purple" "pink" "red" "orange" "yellow" "green" "grey" "all" ] themeVariants
|
|
|
|
lib.checkListOfEnum "${pname}: nautilus sidebar minimum width" [ "default" "180" "220" "240" "260" "280" ] (single nautilusSize)
|
|
|
|
lib.checkListOfEnum "${pname}: panel opacity" [ "default" "30" "45" "60" "75" ] (single panelOpacity)
|
|
|
|
lib.checkListOfEnum "${pname}: panel size" [ "default" "smaller" "bigger" ] (single panelSize)
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "whitesur-gtk-theme";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2023-10-13";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vinceliuice";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-11-16 04:20:00 +00:00
|
|
|
sha256 = "sha256-H8QdKCX6C36J7AfFd0VV9Rnm8LGXSfkxj5Yp2p+PduE=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
glib
|
2021-08-05 21:33:18 +00:00
|
|
|
gnome-shell
|
2022-03-05 16:20:37 +00:00
|
|
|
jdupes
|
2021-06-28 23:13:55 +00:00
|
|
|
libxml2
|
|
|
|
sassc
|
|
|
|
util-linux
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gnome-themes-extra # adwaita engine for Gtk2
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-10-28 06:52:43 +00:00
|
|
|
find -name "*.sh" -print0 | while IFS= read -r -d ''' file; do
|
|
|
|
patchShebangs "$file"
|
|
|
|
done
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
# Do not provide `sudo`, as it is not needed in our use case of the install script
|
2023-02-16 17:41:37 +00:00
|
|
|
substituteInPlace shell/lib-core.sh --replace '$(which sudo)' false
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
# Provides a dummy home directory
|
2023-02-16 17:41:37 +00:00
|
|
|
substituteInPlace shell/lib-core.sh --replace 'MY_HOME=$(getent passwd "''${MY_USERNAME}" | cut -d: -f6)' 'MY_HOME=/tmp'
|
2021-06-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
mkdir -p $out/share/themes
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
./install.sh \
|
|
|
|
${toString (map (x: "--alt " + x) altVariants)} \
|
|
|
|
${toString (map (x: "--color " + x) colorVariants)} \
|
|
|
|
${toString (map (x: "--opacity " + x) opacityVariants)} \
|
|
|
|
${toString (map (x: "--theme " + x) themeVariants)} \
|
|
|
|
${lib.optionalString (nautilusSize != null) ("--size " + nautilusSize)} \
|
|
|
|
${lib.optionalString (panelOpacity != null) ("--panel-opacity " + panelOpacity)} \
|
|
|
|
${lib.optionalString (panelSize != null) ("--panel-size " + panelSize)} \
|
|
|
|
--dest $out/share/themes
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
jdupes --quiet --link-soft --recurse $out/share
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
passthru.updateScript = gitUpdater { };
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "MacOS Big Sur like theme for Gnome desktops";
|
|
|
|
homepage = "https://github.com/vinceliuice/WhiteSur-gtk-theme";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.romildo ];
|
|
|
|
};
|
|
|
|
}
|