Skip to content

nixos/pam: switch to lastlog2#429203

Merged
K900 merged 3 commits intoNixOS:stagingfrom
LordGrimmauld:lastlog2
Aug 10, 2025
Merged

nixos/pam: switch to lastlog2#429203
K900 merged 3 commits intoNixOS:stagingfrom
LordGrimmauld:lastlog2

Conversation

@LordGrimmauld
Copy link
Contributor

@LordGrimmauld LordGrimmauld commented Jul 28, 2025

Adaptation of #282337 to use util-linux as lastlog2 provider

closes #429075

This does pass the nixos tests. However, the following log message might be concerning (flagged as error from tmpfiles):
/etc/tmpfiles.d/uuidd-tmpfiles.conf:6: Failed to resolve user 'uuidd': No such process

One option to fix this is to move all the relevant lastlog outputs of util-linux to a clean $lastlog output, which would contain the lastlog libs, service and tmpfiles definitions while not overly polluting the scope. There might be better ways, i am not sure. Until it is decided how (and whether) to treat this log output, this is a draft.

Fixed by separating lastlog to its own output in util-linux.

cc @arianvp

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.

@LordGrimmauld LordGrimmauld added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. labels Jul 28, 2025
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 8.has: module (update) This PR changes an existing module in `nixos/` and removed 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. labels Jul 28, 2025
LordGrimmauld and others added 2 commits July 31, 2025 16:58
Adaptation of NixOS#282337 to use `util-linux` as `lastlog2` provider

Co-Authored-By: Maxine Aubrey <[email protected]>
@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-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. and removed 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jul 31, 2025
@LordGrimmauld LordGrimmauld force-pushed the lastlog2 branch 2 times, most recently from 0fb83e9 to a513c2e Compare July 31, 2025 20:30
@LordGrimmauld LordGrimmauld changed the base branch from master to staging July 31, 2025 20:40
@nixpkgs-ci nixpkgs-ci bot closed this Jul 31, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Jul 31, 2025
@LordGrimmauld LordGrimmauld changed the title WIP: nixos/pam: switch to lastlog2 nixos/pam: switch to lastlog2 Jul 31, 2025
@LordGrimmauld LordGrimmauld marked this pull request as ready for review July 31, 2025 20:41
@LordGrimmauld LordGrimmauld requested a review from arianvp July 31, 2025 20:54
@Majiir Majiir self-requested a review August 4, 2025 13:18
@LordGrimmauld LordGrimmauld requested a review from K900 August 10, 2025 08:05
@K900 K900 merged commit 801b363 into NixOS:staging Aug 10, 2025
38 of 56 checks passed
Comment on lines +2314 to +2319
systemd = lib.optionalAttrs config.security.pam.services.login.updateWtmp {
tmpfiles.packages = [ pkgs.util-linux.lastlog ]; # /lib/tmpfiles.d/lastlog2-tmpfiles.conf
services.lastlog2-import.enable = true;
packages = [ pkgs.util-linux.lastlog ]; # lib/systemd/system/lastlog2-import.service
};

Copy link
Contributor

Choose a reason for hiding this comment

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

I had marked this PR to review more closely, but I see it was merged before I got the chance.

As noted on the previous attempt, this shouldn't privilege the login service here, but should instead check the updateWtmp option on all PAM services. You can use the enabledServices attrset for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair enough, i can do that in a follow-up. Any changes to the modules here at least won't be mass-rebuilds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Proposed #432567 as a fix, waiting for builds to finish before undrafting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants