Skip to content

Conversation

sjamaan
Copy link
Contributor

@sjamaan sjamaan commented Oct 29, 2024

This packages the librem-ec-acpi-dkms kernel module.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Oct 29, 2024
@sjamaan
Copy link
Contributor Author

sjamaan commented Oct 29, 2024

NOTE: This is basically an updated version of #134856, bumped upstream to use the v0.9.2 branch and renamed the package to librem-ec-acpi (dropped the -dkms suffix as suggested by @K900)

@sjamaan sjamaan force-pushed the sjamaan/librem-ac-acpi branch from 9970087 to 18aa9c0 Compare October 29, 2024 10:36
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Oct 29, 2024
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Nov 12, 2024
@FliegendeWurst
Copy link
Member

@ofborg build linuxKernel.packages.linux_6_6.librem-ec-acpi

@FliegendeWurst
Copy link
Member

LGTM. Would be good to squash the commits.

@sjamaan sjamaan force-pushed the sjamaan/librem-ac-acpi branch from 636b07a to 8a1c00b Compare November 13, 2024 09:16
@sjamaan
Copy link
Contributor Author

sjamaan commented Nov 13, 2024

LGTM. Would be good to squash the commits.

Done

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Nov 14, 2024
Copy link
Member

@me-and me-and left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Picked a random PR to review. Overall looks good, although I think there's a couple of easy-to-fix changes needed to get this over the line.

New maintainer

  • No GPG key, or GPG key is used to sign the commit(s)
  • GitHub account name and ID number match

New package

  • package path fits guidelines
  • package name fits guidelines
  • package version fits guidelines
  • package builds on x86_64-linux
  • executables tested on x86_64-linux (kernel module so nothing to test)
  • meta.description is set and fits guidelines
  • meta.license fits upstream license (see review comment)
  • meta.platforms is set
  • meta.maintainers is set
  • meta.mainProgram is set, if applicable.
  • build time only dependencies are declared in nativeBuildInputs
  • source is fetched using the appropriate function
  • the list of phases is not overridden
  • when a phase (like installPhase) is overridden it starts with runHook preInstall and ends with runHook postInstall.
  • patches have a comment describing either the upstream URL or a reason why the patch wasn't upstreamed (see review comment)
  • patches that are remotely available are fetched rather than vendored

installFlags = [ "DEPMOD=true" ];
enableParallelBuilding = true;

patches = [ ./Makefile.patch ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should either have a comment describing either the upstream URL, or a reason why the patch wasn't upstreamed.


nativeBuildInputs = kernel.moduleBuildDependencies;

buildFlags = [ "all" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this seems unnecessary, as all is the default build target already.

owner = "nicole.faerber";
repo = "librem-ec-acpi-dkms";
rev = "cec8c0e8bf1532c9c605f60bb02a2ef0f98e5d77";
sha256 = "gPb1/4UPbwjJiqtP27KKjiIKxIYEl2nlQACUAlxVEFU=";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: per https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-fetchers-fetchurl-inputs it's generally preferred to provide this as a hash attribute.

domain = "source.puri.sm";
owner = "nicole.faerber";
repo = "librem-ec-acpi-dkms";
rev = "cec8c0e8bf1532c9c605f60bb02a2ef0f98e5d77";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this is the commit hash for the tag, but it'd be clearer to just reference the tag name in my opinion. That'd probably mean you'd want something like

let
  version = "0.9.2";
in
stdenv.mkDerivation {
  version = "${version}-${kernel.version}";
  src = fetchFromGitLab {
    rev = "v${version}";
    ...
  };
  ...
}

@me-and
Copy link
Member

me-and commented Jan 6, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 352070


x86_64-linux

⏩ 2 packages marked as broken and skipped:
  • linuxKernel.packages.linux_5_4_hardened.librem-ec-acpi
  • linuxPackages_5_4_hardened.librem-ec-acpi
❌ 7 packages failed to build:
  • linuxKernel.packages.linux_6_11.librem-ec-acpi
  • linuxPackages_6_11_hardened.librem-ec-acpi (linuxKernel.packages.linux_6_11_hardened.librem-ec-acpi)
  • linuxPackages_latest-libre.librem-ec-acpi (linuxKernel.packages.linux_latest_libre.librem-ec-acpi)
  • linuxPackages_lqx.librem-ec-acpi (linuxKernel.packages.linux_lqx.librem-ec-acpi)
  • linuxPackages_xanmod_latest.librem-ec-acpi (linuxKernel.packages.linux_xanmod_latest.librem-ec-acpi ,linuxPackages_xanmod_stable.librem-ec-acpi)
  • linuxPackages_zen.librem-ec-acpi (linuxKernel.packages.linux_zen.librem-ec-acpi)
  • linuxPackages_latest.librem-ec-acpi
✅ 11 packages built:
  • linuxKernel.packages.linux_5_10.librem-ec-acpi
  • linuxPackages_5_10_hardened.librem-ec-acpi (linuxKernel.packages.linux_5_10_hardened.librem-ec-acpi)
  • linuxKernel.packages.linux_5_15.librem-ec-acpi
  • linuxPackages_5_15_hardened.librem-ec-acpi (linuxKernel.packages.linux_5_15_hardened.librem-ec-acpi)
  • linuxKernel.packages.linux_5_4.librem-ec-acpi
  • linuxKernel.packages.linux_6_1.librem-ec-acpi
  • linuxPackages_6_1_hardened.librem-ec-acpi (linuxKernel.packages.linux_6_1_hardened.librem-ec-acpi)
  • linuxPackages.librem-ec-acpi (linuxKernel.packages.linux_6_6.librem-ec-acpi)
  • linuxPackages_hardened.librem-ec-acpi (linuxPackages_6_6_hardened.librem-ec-acpi)
  • linuxPackages-libre.librem-ec-acpi (linuxKernel.packages.linux_libre.librem-ec-acpi)
  • linuxPackages_xanmod.librem-ec-acpi (linuxKernel.packages.linux_xanmod.librem-ec-acpi)

@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 13, 2025
@sjamaan sjamaan force-pushed the sjamaan/librem-ac-acpi branch from d0a91d6 to 4a490ef Compare January 13, 2025 08:10
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 13, 2025
@sjamaan
Copy link
Contributor Author

sjamaan commented Jan 13, 2025

Thanks for the review! I've made some changes to address your feedback. Please have another look.

@sjamaan sjamaan force-pushed the sjamaan/librem-ac-acpi branch from 4a490ef to f385b97 Compare January 13, 2025 13:35
@me-and
Copy link
Member

me-and commented Jan 13, 2025

Changes look good, although I've not yet tried rebuilding since the failed builds last time around...

@me-and
Copy link
Member

me-and commented Jan 13, 2025

...huh, nixpkgs-review pr 352070 is now reporting "Nothing to be built." I think that must be a lie, given, for example, linuxPackages_latest.librem-ec-acpi exists with this code but not without it.

Nonetheless, I am still getting build failures when I try to build linuxPackages_latest.librem-ec-acpi.

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 14, 2025
@sjamaan
Copy link
Contributor Author

sjamaan commented Jan 14, 2025

...huh, nixpkgs-review pr 352070 is now reporting "Nothing to be built." I think that must be a lie, given, for example, linuxPackages_latest.librem-ec-acpi exists with this code but not without it.

Nonetheless, I am still getting build failures when I try to build linuxPackages_latest.librem-ec-acpi.

I noticed there's an upstream MR which addresses a build failure on Linux 6.10.3. Is this the error you see?

@me-and
Copy link
Member

me-and commented Jan 14, 2025

Yes, that looks like the problem!

/build/source/librem_ec_acpi.c:782:10: error: 'struct acpi_driver' has no member named 'owner'
  782 |         .owner = THIS_MODULE,
      |          ^~~~~

@FliegendeWurst
Copy link
Member

In that case the linked patch should be included here.

@FliegendeWurst FliegendeWurst changed the title Add librem-ec-acpi kernel module linuxPackages.librem-ec-acpi: init Jan 28, 2025
maintainers = [ maintainers.sjamaan ];
license = lib.licenses.gpl2Only;
description = "Kernel module for the Purism Librem EC ACPI DKMS";
platforms = platforms.linux;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
platforms = platforms.linux;
platforms = [ "x86_64-linux" ];

The hardware is only made for x86

@FliegendeWurst
Copy link
Member

FliegendeWurst commented Jan 28, 2025

Please also squash the last three commits so you just have:

  • maintainers: add sjamaan
  • linuxPackages.librem-ec-acpi: init at <version> (with correct version)

Other than that it LGTM. Will merge once you are done :)

Users of NixOS on the Librem 14 laptop from Purism will want to include
this out-of-tree kernel module in their system configuration

  boot.extraModulePackages = with config.boot.kernelPackages;
    [ librem-ec-acpi ];
@sjamaan sjamaan force-pushed the sjamaan/librem-ac-acpi branch from cf54e3e to 7350882 Compare February 12, 2025 12:37
@sjamaan
Copy link
Contributor Author

sjamaan commented Feb 12, 2025

Sorry, was sick for a while and didn't have the energy to pick this back up. Should be good now

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 2, 2025
@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jun 25, 2025
@nixpkgs-ci nixpkgs-ci bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 12.approvals: 1 This PR was reviewed and approved by one person.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants