depot/third_party/nixpkgs/pkgs/data/themes/nordic/default.nix
Default email 2c76a4cb41 Project import generated by Copybara.
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
2023-11-16 04:20:00 +00:00

157 lines
4.9 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, gtk-engine-murrine
, breeze-icons
, plasma-framework
, plasma-workspace
, jdupes
}:
stdenv.mkDerivation rec {
pname = "nordic";
version = "unstable-2023-10-17";
srcs = [
(fetchFromGitHub {
owner = "EliverLara";
repo = pname;
rev = "e97d2bcf4494f8ab502e33d13c74b396469a42f4";
hash = "sha256-7WfCE3eoJ7maAYqgQNb0mlw8u3zc6NAwTJN+PVojDcE=";
name = "Nordic";
})
(fetchFromGitHub {
owner = "EliverLara";
repo = pname;
rev = "73ed3490c13b2df6c3d27d6b3bcba0c087297f4a";
hash = "sha256-fRmGiqtjfGFIfr5hRBS3ZPFYEpQx391WoxphB5gRTJo=";
name = "Nordic-standard-buttons";
})
(fetchFromGitHub {
owner = "EliverLara";
repo = pname;
rev = "4b1fc2942bad203a0aa035cbb688b28005bb1011";
hash = "sha256-VU5Bo39l8xdR6QmbTR0Qic6XkSfDFrhyjoHaMm9SBYM=";
name = "Nordic-darker";
})
(fetchFromGitHub {
owner = "EliverLara";
repo = pname;
rev = "6d57a16eef66c25f0212b7d2f02e208f2afdf4f9";
hash = "sha256-Sq5ZXOh+HA+udQHL2wUw5azgKwAVVvHGNb3SiuOn0nQ=";
name = "Nordic-darker-standard-buttons";
})
(fetchFromGitHub {
owner = "EliverLara";
repo = pname;
rev = "566e38c40bca86df93d0e9226c33d5d525d34454";
hash = "sha256-Wl/m2O0tVCFgZhPC/gcNgKr0JqQbiyQBpGEcp8g6kvY=";
name = "Nordic-bluish-accent";
})
(fetchFromGitHub {
owner = "EliverLara";
repo = pname;
rev = "b43efee28129634fdefe70f2a03c401efc7dc22f";
hash = "sha256-rLOWkfTMFEnVU2tuw5M2fvbNMPfxIu+gzi+3gnBEhx4=";
name = "Nordic-bluish-accent-standard-buttons";
})
(fetchFromGitHub {
owner = "EliverLara";
repo = "${pname}-polar";
rev = "2192acfce55fbb9a2982886abe25e623d0e7ff66";
hash = "sha256-B/sAy4I+9gX9dHXUldcN5t0vlOL2Jnoan/hRV+tNnSo=";
name = "Nordic-Polar";
})
(fetchFromGitHub {
owner = "EliverLara";
repo = "${pname}-polar";
rev = "a24b42411d8ea0dc63bf0778e443be251858e586";
hash = "sha256-02z4eMFtok1+SeW+ai7vZCXZb6ZhU4l4ch1Zc/GyhYM=";
name = "Nordic-Polar-standard-buttons";
})
];
sourceRoot = ".";
outputs = [ "out" "sddm" ];
nativeBuildInputs = [ jdupes ];
propagatedUserEnvPkgs = [ gtk-engine-murrine ];
dontWrapQtApps = true;
installPhase = ''
runHook preInstall
# install theme files
mkdir -p $out/share/themes
cp -a Nordic* $out/share/themes
# remove uneeded files
rm -r $out/share/themes/*/.gitignore
rm -r $out/share/themes/*/Art
rm -r $out/share/themes/*/FUNDING.yml
rm -r $out/share/themes/*/LICENSE
rm -r $out/share/themes/*/README.md
rm -r $out/share/themes/*/{package.json,package-lock.json,Gulpfile.js}
rm -r $out/share/themes/*/src
rm -r $out/share/themes/*/cinnamon/*.scss
rm -r $out/share/themes/*/gnome-shell/{earlier-versions,extensions,*.scss}
rm -r $out/share/themes/*/gtk-2.0/{assets.svg,assets.txt,links.fish,render-assets.sh}
rm -r $out/share/themes/*/gtk-3.0/{apps,widgets,*.scss}
rm -r $out/share/themes/*/gtk-4.0/{apps,widgets,*.scss}
rm -r $out/share/themes/*/xfwm4/{assets,render_assets.fish}
# move wallpapers to appropriate directory
mkdir -p $out/share/wallpapers/Nordic
mv -v $out/share/themes/Nordic/extras/wallpapers/* $out/share/wallpapers/Nordic/
rmdir $out/share/themes/Nordic/extras{/wallpapers,}
# move kde related contents to appropriate directories
mkdir -p $out/share/{aurorae/themes,color-schemes,Kvantum,plasma,icons}
mv -v $out/share/themes/Nordic/kde/aurorae/* $out/share/aurorae/themes/
mv -v $out/share/themes/Nordic/kde/colorschemes/* $out/share/color-schemes/
mv -v $out/share/themes/Nordic/kde/konsole $out/share/
mv -v $out/share/themes/Nordic/kde/kvantum/* $out/share/Kvantum/
mv -v $out/share/themes/Nordic/kde/plasma/look-and-feel $out/share/plasma/
mv -v $out/share/themes/Nordic/kde/folders/* $out/share/icons/
mv -v $out/share/themes/Nordic/kde/cursors/*-cursors $out/share/icons/
mkdir -p $sddm/share/sddm/themes
mv -v $out/share/themes/Nordic/kde/sddm/* $sddm/share/sddm/themes/
rm -rf $out/share/themes/Nordic/kde
# Replace duplicate files with symbolic links to the first file in
# each set of duplicates, reducing the installed size in about 53%
jdupes --quiet --link-soft --recurse $out/share
runHook postInstall
'';
postFixup = ''
# Propagate sddm theme dependencies to user env otherwise sddm
# does find them. Putting them in buildInputs is not enough.
mkdir -p $sddm/nix-support
printWords ${breeze-icons} ${plasma-framework} ${plasma-workspace} \
>> $sddm/nix-support/propagated-user-env-packages
'';
meta = with lib; {
description = "Gtk and KDE themes using the Nord color pallete";
homepage = "https://github.com/EliverLara/Nordic";
license = licenses.gpl3Only;
platforms = platforms.all;
maintainers = [ maintainers.romildo ];
};
}