diff --git a/nixos/modules/services/hardware/ddccontrol.nix b/nixos/modules/services/hardware/ddccontrol.nix index 766bf12ee9f0..f0b5a9c81960 100644 --- a/nixos/modules/services/hardware/ddccontrol.nix +++ b/nixos/modules/services/hardware/ddccontrol.nix @@ -20,6 +20,9 @@ in ###### implementation config = lib.mkIf cfg.enable { + # Load the i2c-dev module + boot.kernelModules = [ "i2c_dev" ]; + # Give users access to the "gddccontrol" tool environment.systemPackages = [ pkgs.ddccontrol diff --git a/pkgs/tools/misc/ddccontrol/default.nix b/pkgs/tools/misc/ddccontrol/default.nix index 2a85c0dc2b8f..f89626c55ffd 100644 --- a/pkgs/tools/misc/ddccontrol/default.nix +++ b/pkgs/tools/misc/ddccontrol/default.nix @@ -12,13 +12,13 @@ stdenv.mkDerivation rec { pname = "ddccontrol"; - version = "0.5.2"; + version = "0.6.0"; src = fetchFromGitHub { owner = "ddccontrol"; repo = "ddccontrol"; - rev = "0.5.2"; - sha256 = "sha256-kul0sjbwbCwadvrccG3KwL/fKWACFUg74QGvgfWE4FQ="; + rev = version; + sha256 = "00pmnzvd4l3w6chzw41mrf1pd7lrcwi1n7320bnq20rn8hsnbnxk"; }; nativeBuildInputs = [ @@ -39,10 +39,17 @@ stdenv.mkDerivation rec { ]; prePatch = '' - oldPath="\$""{datadir}/ddccontrol-db" - newPath="${ddccontrol-db}/share/ddccontrol-db" - sed -i -e "s|$oldPath|$newPath|" configure.ac - sed -i -e "s/chmod 4711/chmod 0711/" src/ddcpci/Makefile* + substituteInPlace configure.ac \ + --replace \ + "\$""{datadir}/ddccontrol-db" \ + "${ddccontrol-db}/share/ddccontrol-db" + + substituteInPlace src/ddcpci/Makefile.am \ + --replace "chmod 4711" "chmod 0711" + '' + lib.optionalString (lib.versionAtLeast "0.6.0" version) '' + # Upstream PR: https://github.com/ddccontrol/ddccontrol/pull/115 + substituteInPlace src/lib/Makefile.am \ + --replace "/etc/" "\$""{sysconfdir}/" ''; preConfigure = ''