summary refs log tree commit diff
path: root/pkgs/data/themes/mojave/default.nix
diff options
context:
space:
mode:
authorJosé Romildo <malaquias@gmail.com>2022-01-13 10:56:01 -0300
committerJosé Romildo <malaquias@gmail.com>2022-01-13 11:00:36 -0300
commit525962b064b05860ceaf4d0e5bf791dbd5f72673 (patch)
tree28068534d85f9b408aa8112f016a031e2db5ec7c /pkgs/data/themes/mojave/default.nix
parent1a808ce3844fe5782b62c767ac443a49b9e2dc3c (diff)
downloadnixpkgs-525962b064b05860ceaf4d0e5bf791dbd5f72673.tar
nixpkgs-525962b064b05860ceaf4d0e5bf791dbd5f72673.tar.gz
nixpkgs-525962b064b05860ceaf4d0e5bf791dbd5f72673.tar.bz2
nixpkgs-525962b064b05860ceaf4d0e5bf791dbd5f72673.tar.lz
nixpkgs-525962b064b05860ceaf4d0e5bf791dbd5f72673.tar.xz
nixpkgs-525962b064b05860ceaf4d0e5bf791dbd5f72673.tar.zst
nixpkgs-525962b064b05860ceaf4d0e5bf791dbd5f72673.zip
mojave-gtk-theme: add optional arguments
Diffstat (limited to 'pkgs/data/themes/mojave/default.nix')
-rw-r--r--pkgs/data/themes/mojave/default.nix34
1 files changed, 30 insertions, 4 deletions
diff --git a/pkgs/data/themes/mojave/default.nix b/pkgs/data/themes/mojave/default.nix
index c1ed0721a48..56d7dfcf375 100644
--- a/pkgs/data/themes/mojave/default.nix
+++ b/pkgs/data/themes/mojave/default.nix
@@ -10,10 +10,25 @@
 , optipng
 , sassc
 , which
+, buttonSizeVariants ? [] # default to standard
+, buttonVariants ? [] # default to all
+, colorVariants ? [] # default to all
+, opacityVariants ? [] # default to all
+, themeVariants ? [] # default to MacOS blue
+, wallpapers ? false
 }:
 
-stdenv.mkDerivation rec {
+let
   pname = "mojave-gtk-theme";
+in
+lib.checkListOfEnum "${pname}: button size variants" [ "standard" "small" ] buttonSizeVariants
+lib.checkListOfEnum "${pname}: button variants" [ "standard" "alt" ] buttonVariants
+lib.checkListOfEnum "${pname}: color variants" [ "light" "dark" ] colorVariants
+lib.checkListOfEnum "${pname}: opacity variants" [ "standard" "solid" ] opacityVariants
+lib.checkListOfEnum "${pname}: theme variants" [ "default" "blue" "purple" "pink" "red" "orange" "yellow" "green" "grey" "all" ] themeVariants
+
+stdenv.mkDerivation rec {
+  inherit pname;
   version = "unstable-2021-12-20";
 
   srcs = [
@@ -23,11 +38,14 @@ stdenv.mkDerivation rec {
       rev = "c148646ccab382f7a2d5fdc421fc32d843cb4172";
       sha256 = "sha256-h4MSSh8cu9M81bM+WJSyl1SQ7CVth1DvjIVOUJXqpxs";
     })
+  ]
+  ++
+  lib.optional wallpapers
     (fetchurl {
       url = "https://github.com/vinceliuice/Mojave-gtk-theme/raw/11741a99d96953daf9c27e44c94ae50a7247c0ed/macOS_Mojave_Wallpapers.tar.xz";
       sha256 = "18zzkwm1kqzsdaj8swf0xby1n65gxnyslpw4lnxcx1rphip0rwf7";
     })
-  ];
+  ;
 
   sourceRoot = "source";
 
@@ -77,9 +95,17 @@ stdenv.mkDerivation rec {
   installPhase = ''
     runHook preInstall
 
-    name= ./install.sh --theme all --dest $out/share/themes
+    name= ./install.sh \
+      ${lib.optionalString (buttonSizeVariants != []) "--small " + builtins.toString buttonSizeVariants} \
+      ${lib.optionalString (buttonVariants != []) "--alt " + builtins.toString buttonVariants} \
+      ${lib.optionalString (colorVariants != []) "--color " + builtins.toString colorVariants} \
+      ${lib.optionalString (opacityVariants != []) "--opacity " + builtins.toString opacityVariants} \
+      ${lib.optionalString (themeVariants != []) "--theme " + builtins.toString themeVariants} \
+      --dest $out/share/themes
 
-    install -D -t $out/share/wallpapers ../"macOS Mojave Wallpapers"/*
+    ${lib.optionalString wallpapers ''
+      install -D -t $out/share/wallpapers ../"macOS Mojave Wallpapers"/*
+    ''}
 
     # Replace duplicate files with hardlinks to the first file in each
     # set of duplicates, reducing the installed size in about 53%