From 405fdb241a62f5698125109a71c09f15b802c372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo?= Date: Tue, 11 Jan 2022 11:44:37 -0300 Subject: [PATCH] sierra-gtk-theme: add optional arguments --- pkgs/data/themes/sierra/default.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pkgs/data/themes/sierra/default.nix b/pkgs/data/themes/sierra/default.nix index fb960d843abd..d7c512cde474 100644 --- a/pkgs/data/themes/sierra/default.nix +++ b/pkgs/data/themes/sierra/default.nix @@ -6,10 +6,22 @@ , jdupes , librsvg , libxml2 +, buttonVariants ? [] # default to all +, colorVariants ? [] # default to all +, opacityVariants ? [] # default to all +, sizeVariants ? [] # default to all }: -stdenv.mkDerivation rec { +let pname = "sierra-gtk-theme"; +in +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}: size variants" [ "standard" "compact" ] sizeVariants + +stdenv.mkDerivation { + inherit pname; version = "unstable-2021-05-24"; src = fetchFromGitHub { @@ -39,7 +51,11 @@ stdenv.mkDerivation rec { patchShebangs . mkdir -p $out/share/themes - name= ./install.sh --dest $out/share/themes + name= ./install.sh --dest $out/share/themes \ + ${lib.optionalString (buttonVariants != []) "--alt " + builtins.toString buttonVariants} \ + ${lib.optionalString (colorVariants != []) "--color " + builtins.toString colorVariants} \ + ${lib.optionalString (opacityVariants != []) "--opacity " + builtins.toString opacityVariants} \ + ${lib.optionalString (sizeVariants != []) "--flat " + builtins.toString sizeVariants} # Replace duplicate files with hardlinks to the first file in each # set of duplicates, reducing the installed size in about 79%