Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 71 lines 1.9 kB view raw
1{ 2 lib, 3 stdenv, 4 qt6, 5 makeDesktopItem, 6 copyDesktopItems, 7 fetchFromGitHub, 8 cmake, 9 kmod, 10}: 11 12stdenv.mkDerivation (finalAttrs: { 13 pname = "mcontrolcenter"; 14 version = "0.5.1"; 15 16 src = fetchFromGitHub { 17 owner = "dmitry-s93"; 18 repo = "MControlCenter"; 19 rev = finalAttrs.version; 20 hash = "sha256-uWxEWLb2QOZlJ1d3LbORCc81kILB9N+0bzr+xzHAa7Y="; 21 }; 22 23 postPatch = '' 24 substituteInPlace src/helper/helper.cpp \ 25 --replace-fail "/usr/sbin/modprobe" "${kmod}/bin/modprobe" 26 substituteInPlace src/helper/mcontrolcenter.helper.service \ 27 --replace-fail "/usr" "$out" 28 ''; 29 30 desktopItems = [ 31 (makeDesktopItem { 32 name = "MControlCenter"; 33 exec = "mcontrolcenter"; 34 icon = "mcontrolcenter"; 35 comment = finalAttrs.meta.description; 36 desktopName = "MControlCenter"; 37 categories = [ "System" ]; 38 }) 39 ]; 40 41 nativeBuildInputs = [ 42 qt6.wrapQtAppsHook 43 qt6.qttools 44 copyDesktopItems 45 cmake 46 ]; 47 48 buildInputs = [ 49 qt6.qtbase 50 kmod 51 ]; 52 53 installPhase = '' 54 runHook preInstall 55 install -Dm755 mcontrolcenter $out/bin/mcontrolcenter 56 install -Dm755 helper/mcontrolcenter-helper $out/libexec/mcontrolcenter-helper 57 install -Dm644 ../resources/mcontrolcenter.svg $out/share/icons/hicolor/scalable/apps/mcontrolcenter.svg 58 install -Dm644 ../src/helper/mcontrolcenter-helper.conf $out/share/dbus-1/system.d/mcontrolcenter-helper.conf 59 install -Dm644 ../src/helper/mcontrolcenter.helper.service $out/share/dbus-1/system-services/mcontrolcenter.helper.service 60 runHook postInstall 61 ''; 62 63 meta = { 64 homepage = "https://github.com/dmitry-s93/MControlCenter"; 65 description = "Tool to change the settings of MSI laptops running Linux"; 66 license = lib.licenses.gpl3Plus; 67 platforms = lib.platforms.linux; 68 maintainers = [ lib.maintainers.Tommimon ]; 69 mainProgram = "mcontrolcenter"; 70 }; 71})