Skip to content

nixos/rust-motd: use existing PAM options to configure pam_motd - #420885

Merged
Ma27 merged 1 commit into
NixOS:masterfrom
Majiir:rust-motd_pam_options
Jul 5, 2025
Merged

Ma27 merged 1 commit into
NixOS:masterfrom
Majiir:rust-motd_pam_options

Conversation

@Majiir

@Majiir Majiir commented Jun 28, 2025 •

Copy link
Copy Markdown
Contributor

Replaces the manual PAM rule created in programs.rust-motd with simpler security.pam options.

One of our goals for security.pam refactoring is to eliminate the text option and create structured rules instead (see #255547). In this case, defining an motd rule here appears to be unnecessary, since there is already an motd rule in the default rule stack.

security.pam.services.<service>.showMotd controls whether that rule is enabled in each service. By default, it is enabled for login and sshd as long as an MOTD is defined with either users.motd or users.motdFile. It is disabled by default for all other services.

users.motd and users.motdFile are only used by (and are defined in) security.pam, so a rename can fix the awkward-looking config. The other bit of awkwardness is that only one MOTD can be defined for all services. But that is (a) something I plan to fix in security.pam, by making all services independently configurable, and (b) probably not really an issue for this module.

@Ma27 What do you think?

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/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (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, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

@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: 0 This PR does not cause any packages to rebuild on Darwin. 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/` labels Jun 28, 2025
@nixpkgs-ci nixpkgs-ci Bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Jul 4, 2025
@Ma27
Ma27 merged commit dc3b2f4 into NixOS:master Jul 5, 2025
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/` 9.needs: reviewer This PR currently has no reviewers requested and needs attention. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants