Skip to content

util-linux: use systemdLibs, minor cleanup#439122

Merged
numinit merged 4 commits into
NixOS:stagingfrom
drupol:push-xxtlqwxvtynv
Sep 3, 2025
Merged

util-linux: use systemdLibs, minor cleanup#439122
numinit merged 4 commits into
NixOS:stagingfrom
drupol:push-xxtlqwxvtynv

Conversation

@drupol

@drupol drupol commented Sep 1, 2025

Copy link
Copy Markdown
Contributor

I was investigating why systemd was required in a Home Manager profile when I found out that util-linux was requiring it.

This PR is a proposal, similar to #433641

Feel free to let me know what you think.

Here's the closure size after/before:

❯ nix path-info -Sh ./result-bin
/nix/store/qx5wjl2d6bpy82vwkvv9hfm3nfbsm44r-util-linux-2.41.1-bin         88.1 MiB
❯ jj new master
❯ nix-build -A util-linux
/nix/store/ad5skbqn01fbmgwd0b879zy5x5skgxj1-util-linux-2.41.1-bin
❯ nix path-info -Sh ./result-bin
/nix/store/ad5skbqn01fbmgwd0b879zy5x5skgxj1-util-linux-2.41.1-bin        206.7 MiB

On top of that, this PR make a very minor cleanup in the postInstall attribute, regrouping lines that are meant to be together, making it easier to read.

Lastly, it also fixes the use of the finalAttrs pattern, there's no need to use rec when using it.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@vog vog self-requested a review September 1, 2025 09:23

@vog vog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All 3 commits look fine to me!

@vog vog requested review from aanderse and r-vdp September 1, 2025 09:26
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person. labels Sep 1, 2025
@vog

vog commented Sep 1, 2025

Copy link
Copy Markdown
Contributor

@drupol The changes themselves are fine! However:

  1. Please rebase your PR on the "staging" branch, because of the many rebuilds it triggers (see also php: fix systemdLibs dependency #433641).
  2. Please update your PR description to clarify that this PR also performs some code cleanup in addition to the actual change to systemdLibs (which are all fine, but should be mentioned early on)
  3. Please tick the appropriate check boxes in "Things done", e.g. whether you have successfully built it on the
    x86_64-linux platform.

@nix-owners nix-owners Bot requested a review from numinit September 1, 2025 09:30
@drupol drupol marked this pull request as draft September 1, 2025 09:36
@drupol drupol changed the base branch from master to staging September 1, 2025 09:36
@nixpkgs-ci nixpkgs-ci Bot closed this Sep 1, 2025
@nixpkgs-ci nixpkgs-ci Bot reopened this Sep 1, 2025
@drupol drupol changed the title util-linux: use systemdLibs util-linux: use systemdLibs, minor cleanup Sep 1, 2025
@drupol drupol marked this pull request as ready for review September 1, 2025 09:42
@vog vog self-requested a review September 1, 2025 09:48

@vog vog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks all very good to me! 👍

Comment thread pkgs/by-name/ut/util-linux/package.nix
Comment thread pkgs/by-name/ut/util-linux/package.nix Outdated
@numinit

numinit commented Sep 1, 2025

Copy link
Copy Markdown
Contributor

This is a good change! One thing consumers can always do is depend on util-linuxMinimal if you don't want systemd or other "bloat" at all.

Comment thread pkgs/by-name/ut/util-linux/package.nix Outdated
Comment thread pkgs/by-name/ut/util-linux/package.nix Outdated
See TODO in NixOS#432567 for context

Co-authored-by: Grimmauld <soeren@benjos.de>
@LordGrimmauld

Copy link
Copy Markdown
Contributor

Btw if you are interested in reducing the reverse closure of util-linux: The currently biggest consumers are qt6 qtbase, xvfb-run and polkit, everything else is less than 1k reverse dependencies. You might want to look into whether those can use minimal util-linux. I do expect polkit would want systemd/pam though.

@numinit

numinit commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

Looks good, I can still build up to util-linux.

@numinit numinit merged commit 1aba691 into NixOS:staging Sep 3, 2025
28 of 31 checks passed
@drupol drupol deleted the push-xxtlqwxvtynv branch September 3, 2025 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 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