nixpkgs/pkgs/applications/misc/redshift-plasma-applet/default.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

74 lines
2.0 KiB
Nix

{
lib,
stdenv,
cmake,
extra-cmake-modules,
plasma-framework,
kwindowsystem,
redshift,
fetchFromGitHub,
fetchpatch,
}:
let
version = "1.0.18";
in
stdenv.mkDerivation {
pname = "redshift-plasma-applet";
inherit version;
src = fetchFromGitHub {
owner = "kotelnik";
repo = "plasma-applet-redshift-control";
rev = "v${version}";
sha256 = "122nnbafa596rxdxlfshxk45lzch8c9342bzj7kzrsjkjg0xr9pq";
};
patches = [
# This patch fetches from out-of-source repo because the GitHub copy is frozen,
# the active fork is now on invent.kde.org. Remove this patch when a new version is released and src is updated
# Redshift version >= 1.12 requires the -P option to clear the existing effects before applying shading.
# Without it scrolling makes the screen gets darker and darker until it is impossible to see anything.
(fetchpatch {
url = "https://invent.kde.org/plasma/plasma-redshift-control/-/commit/898c3a4cfc6c317915f1e664078d8606497c4049.patch";
sha256 = "0b6pa3fcj698mgqnc85jbbmcl3qpf418mh06qgsd3c4v237my0nv";
})
];
patchPhase = ''
substituteInPlace package/contents/ui/main.qml \
--replace "redshiftCommand: 'redshift'" \
"redshiftCommand: '${redshift}/bin/redshift'" \
--replace "redshiftOneTimeCommand: 'redshift -O " \
"redshiftOneTimeCommand: '${redshift}/bin/redshift -O "
substituteInPlace package/contents/ui/config/ConfigAdvanced.qml \
--replace "'redshift -V'" \
"'${redshift}/bin/redshift -V'"
'';
nativeBuildInputs = [
cmake
extra-cmake-modules
];
buildInputs = [
plasma-framework
kwindowsystem
];
dontWrapQtApps = true;
meta = with lib; {
description = "KDE Plasma 5 widget for controlling Redshift";
homepage = "https://github.com/kotelnik/plasma-applet-redshift-control";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [
benley
zraexy
];
};
}