From 4adde8f35b6f5c6d647aeb3bca37b0d6a9dd5652 Mon Sep 17 00:00:00 2001 From: eljamm Date: Wed, 14 May 2025 23:09:35 +0200 Subject: [PATCH] linuxPackages.system76-acpi: small improvements - use `finalAttrs` - use `tag` and `hash` in `src` - add {pre,post} hooks to the `installPhase` - remove `with lib;` from `meta` --- .../linux/system76-acpi/default.nix | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pkgs/os-specific/linux/system76-acpi/default.nix b/pkgs/os-specific/linux/system76-acpi/default.nix index 06335791ed13..40c8fb09165a 100644 --- a/pkgs/os-specific/linux/system76-acpi/default.nix +++ b/pkgs/os-specific/linux/system76-acpi/default.nix @@ -4,20 +4,17 @@ fetchFromGitHub, kernel, }: -let +stdenv.mkDerivation (finalAttrs: { + name = "system76-acpi-module-${finalAttrs.version}-${kernel.version}"; version = "1.0.2"; - sha256 = "1i7zjn5cdv9h00fgjg46b8yrz4d3dqvfr25g3f13967ycy58m48h"; -in -stdenv.mkDerivation { - name = "system76-acpi-module-${version}-${kernel.version}"; passthru.moduleName = "system76_acpi"; src = fetchFromGitHub { owner = "pop-os"; repo = "system76-acpi-dkms"; - rev = version; - inherit sha256; + tag = finalAttrs.version; + hash = "sha256-EJGKimf+mDSCG6+I7DZuo5GfPVqGPPkcADDtxoqV/8Q="; }; hardeningDisable = [ "pic" ]; @@ -29,17 +26,21 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + install -D system76_acpi.ko $out/lib/modules/${kernel.modDirVersion}/misc/system76_acpi.ko mkdir -p $out/lib/udev/hwdb.d mv lib/udev/hwdb.d/* $out/lib/udev/hwdb.d + + runHook postInstall ''; # GCC 14 makes this an error by default, remove when fixed upstream env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; - meta = with lib; { + meta = { maintainers = with lib.maintainers; [ ahoneybun ]; - license = [ licenses.gpl2Only ]; + license = [ lib.licenses.gpl2Only ]; platforms = [ "i686-linux" "x86_64-linux" @@ -51,4 +52,4 @@ stdenv.mkDerivation { This provides the system76_acpi in-tree driver for systems missing it. ''; }; -} +})