nixpkgs/pkgs/by-name/or/oreo-cursors-plus/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

75 lines
1.9 KiB
Nix

{
lib,
stdenvNoCC,
fetchFromGitHub,
ruby,
inkscape,
xorg,
writeText,
cursorsConf ? null, # If set to a string, overwrites contents of './cursors.conf'
}:
let
newCursorsConf = writeText "oreo-cursors-plus.conf" cursorsConf;
in
stdenvNoCC.mkDerivation {
pname = "oreo-cursors-plus";
version = "unstable-2023-06-05";
src = fetchFromGitHub {
owner = "Souravgoswami";
repo = "oreo-cursors";
# At the time of writing, there are no version tags. The author will add them starting with the next version release.
# Using the latest commit instead.
rev = "9133204d60ca2c54be0df03b836968a1deac6b20";
hash = "sha256-6oTyOQK7mkr+jWYbPNBlJ4BpT815lNJvsJjzdTmj+68=";
};
nativeBuildInputs = lib.optionals (cursorsConf != null) [
ruby
inkscape
xorg.xcursorgen
];
# './cursors.conf' contains definitions of cursor variations to generate.
configurePhase = ''
runHook preConfigure
${lib.optionalString (cursorsConf != null) ''
cp ${newCursorsConf} cursors.conf
''}
runHook postConfigure
'';
# The repo already contains the default cursors pre-generated in './dist'. Just copy these if './cursors.conf' is not overwritten.
# Otherwise firs remove all default variations and build.
buildPhase = ''
runHook preBuild
${lib.optionalString (cursorsConf != null) ''
rm -r {dist,src/oreo_*}
export HOME=$TMP
ruby generator/convert.rb
make build
''}
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share
mv ./dist $out/share/icons
runHook postInstall
'';
meta = {
description = "Colored Material cursors with cute animations";
homepage = "https://github.com/Souravgoswami/oreo-cursors";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ michaelBrunner ];
};
}