nixpkgs/pkgs/by-name/ca/catppuccin-papirus-folders/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

55 lines
1.6 KiB
Nix

{
stdenvNoCC,
lib,
fetchFromGitHub,
gtk3,
papirus-icon-theme,
flavor ? "mocha",
accent ? "blue"
}: let
validAccents = ["blue" "flamingo" "green" "lavender" "maroon" "mauve" "peach" "pink" "red" "rosewater" "sapphire" "sky" "teal" "yellow"];
validFlavors = ["latte" "frappe" "macchiato" "mocha"];
pname = "catppuccin-papirus-folders";
in
lib.checkListOfEnum "${pname}: accent colors" validAccents [ accent ]
lib.checkListOfEnum "${pname}: flavors" validFlavors [ flavor ]
stdenvNoCC.mkDerivation {
inherit pname;
version = "unstable-2023-08-02";
src = fetchFromGitHub {
owner = "catppuccin";
repo = "papirus-folders";
rev = "fcf96737fffc343a1bf129732c37d19f2d77fa5c";
sha256 = "sha256-3yjIGzN+/moP2OVGDIAy4zPqUroSjx3c2mJjdZGhTsY=";
};
nativeBuildInputs = [ gtk3 ];
postPatch = ''
patchShebangs ./papirus-folders
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/icons
cp -r --no-preserve=mode ${papirus-icon-theme}/share/icons/Papirus* $out/share/icons
cp -r src/* $out/share/icons/Papirus
for theme in $out/share/icons/*; do
USER_HOME=$HOME DISABLE_UPDATE_ICON_CACHE=1 \
./papirus-folders -t $theme -o -C cat-${flavor}-${accent}
gtk-update-icon-cache --force $theme
done
runHook postInstall
'';
meta = with lib; {
description = "Soothing pastel theme for Papirus Icon Theme folders";
homepage = "https://github.com/catppuccin/papirus-folders";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ rubyowo ];
};
}