From 08a1728622171f064f7190a101b1a25dad725903 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Wed, 11 Mar 2020 20:14:21 -0400 Subject: [PATCH] add openrgb --- default.nix | 3 +++ nix/sources.json | 12 +++++----- pkgs/openrgb/default.nix | 47 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 pkgs/openrgb/default.nix diff --git a/default.nix b/default.nix index 917ab49..c2b834d 100644 --- a/default.nix +++ b/default.nix @@ -34,6 +34,9 @@ let # Go tools gopls = callPackage ./pkgs/gopls { }; + # OpenRGB + OpenRGB = callPackage ./pkgs/openrgb { }; + # x appsluggr = x.appsluggr; license = x.license; diff --git a/nix/sources.json b/nix/sources.json index cc2205f..b6b2df2 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "", "owner": "pigpigyyy", "repo": "MoonPlus", - "rev": "3b94999e55df35d19616e87d7f3b6fddf5b8a30b", - "sha256": "1jwx7m5736mn5jwp7r9bq1df46dzyncra7ywki1yv614wvj69iym", + "rev": "acbfdb949bde46c0192719bbeffa8415f6976e1a", + "sha256": "1ynvj9p33w8zr05mirv4g15gl217rialqwqs9wxzsc8hb3f5wad3", "type": "tarball", - "url": "https://github.com/pigpigyyy/MoonPlus/archive/3b94999e55df35d19616e87d7f3b6fddf5b8a30b.tar.gz", + "url": "https://github.com/pigpigyyy/MoonPlus/archive/acbfdb949bde46c0192719bbeffa8415f6976e1a.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "easy-dhall-nix": { @@ -41,10 +41,10 @@ "homepage": "https://github.com/NixOS/nixpkgs", "owner": "NixOS", "repo": "nixpkgs-channels", - "rev": "ca3531850844e185d483fb878fcd00c6b44069e5", - "sha256": "1s1zhzdbmdd7l936g7ydzsjqdi5k5ch6vpjilil0jiwjhrpkw3m4", + "rev": "04d6123309fa5f89b436472d7b4fd418f8c3106f", + "sha256": "06755h2cxrsgrsiclxbk3h5d7yqajvjjq3y4pl1dqbxfbjhq0h67", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs-channels/archive/ca3531850844e185d483fb878fcd00c6b44069e5.tar.gz", + "url": "https://github.com/NixOS/nixpkgs-channels/archive/04d6123309fa5f89b436472d7b4fd418f8c3106f.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "quickserv": { diff --git a/pkgs/openrgb/default.nix b/pkgs/openrgb/default.nix new file mode 100644 index 0000000..fdb7ce4 --- /dev/null +++ b/pkgs/openrgb/default.nix @@ -0,0 +1,47 @@ +{ sources ? import ../../nix/sources.nix +, pkgs ? import sources.nixpkgs { } +}: +with pkgs; +stdenv.mkDerivation rec { + pname = "openrgb"; + version = "unstable-${date}"; + + date = "2020-03-03"; + + src = fetchFromGitHub { + owner = "CalcProgrammer1"; + repo = "OpenRGB"; + rev = "d7298cafd02232a4da3843a5e6c810cb2ccd99f4"; + sha256 = "0gjj8z3574dxx41d38khhq91c6g2z5jiws5k9hg0lryks97341ak"; + fetchSubmodules = true; + }; + + buildInputs = [ libusb1 hidapi qt5.wrapQtAppsHook ]; + + propagatedBuildInputs = [ hicolor-icon-theme openrazer-daemon ]; + + nativeBuildInputs = [ qt5.qmake makeWrapper ]; + + postPatch = '' + substituteInPlace OpenRGB.pro \ + --replace '$$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ rev-parse HEAD)' "${src.rev}" \ + --replace '$$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ show -s --format=%ci HEAD)' "${date}" \ + --replace '$$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ rev-parse --abbrev-ref HEAD)' "master" + ''; + + installPhase = '' + mkdir -p $out/bin + install -m755 OpenRGB $out/bin + ''; + + meta = with stdenv.lib; { + description = "Open source RGB lighting control that doesn't depend on manufacturer software."; + maintainers = with maintainers; [ evanjs ]; + longDescription = '' + The goal of this project is to create an easy-to-use open source + software program and library for accessing and controlling + RGB lights on various PC hardware including motherboards, + RAM modules, graphics cards, cooling devices, and peripherals. + ''; + }; +}