Skip to content

nixos/systemd/tmpfiles: add provision.conf - #543333

Open
arianvp wants to merge 2 commits into
NixOS:staging-nixosfrom
arianvp:push-vtwzyomyxwuw
Open

arianvp wants to merge 2 commits into
NixOS:staging-nixosfrom
arianvp:push-vtwzyomyxwuw

Conversation

@arianvp

@arianvp arianvp commented Jul 18, 2026

Copy link
Copy Markdown
Member

Adds some credentials for provisioning a server with files

this provisions:

  • the root user's ssh key from the ssh.authorized_keys.root credential
  • /etc/hosts from the network.hosts credential
  • creates a dropin in /etc/motd.d from the login.motd credential
  • and a dropin in /etc/issue.d from the logging.issue credential

The last two drop-ins are not being picked up by NixOS at the moment
but we can add them in follow-up PR

Things done

@arianvp
arianvp requested a review from nikstur July 18, 2026 21:49

@nixpkgs-branch-check nixpkgs-branch-check Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The PR's base branch is set to master, but this PR rebuilds all NixOS tests.

Please change the base branch to the right base branch for your changes (probably staging-nixos).

@nixpkgs-ci
nixpkgs-ci Bot requested a review from a team July 18, 2026 21:54
@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. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 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/` 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. labels Jul 18, 2026
arianvp added 2 commits July 19, 2026 11:50
Adds some credentials for provisioning a server with files

this provisions:
* the root user's ssh key from the ssh.authorized_keys.root credential
* /etc/hosts from the network.hosts credential 
* creates a dropin in /etc/motd.d from the login.motd credential 
* and a dropin in /etc/issue.d from the logging.issue credential

The last two drop-ins are not being picked up by NixOS at the moment
but we can add them in follow-up PR
@arianvp
arianvp force-pushed the push-vtwzyomyxwuw branch from 5036036 to ea89c78 Compare July 19, 2026 09:50
@arianvp
arianvp changed the base branch from master to staging-nixos July 19, 2026 09:51
@nixpkgs-ci nixpkgs-ci Bot closed this Jul 19, 2026
@nixpkgs-ci nixpkgs-ci Bot reopened this Jul 19, 2026
@NyCodeGHG

Copy link
Copy Markdown
Member

Back when I added support for ssh-generator I think there was some discussion to not use provision.conf for that, so we also can remove this afaik, since provision.conf already does this:

systemd.tmpfiles.settings."ssh-root-provision" = {
"/root"."d-" = {
user = "root";
group = ":root";
mode = ":700";
};
"/root/.ssh"."d-" = {
user = "root";
group = ":root";
mode = ":700";
};
"/root/.ssh/authorized_keys"."f^" = {
user = "root";
group = ":root";
mode = ":600";
argument = "ssh.authorized_keys.root";
};
};

@arianvp

arianvp commented Aug 11, 2026 •

Copy link
Copy Markdown
Member Author

Ah thanks. I'll add a commit removing that snippet from the module! We shouldn't have the same code twice :)

Link to the discussion for completeness: #372979 (comment)

@arianvp

arianvp commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

Unless people feel heavily against including the upstream file?

@ElvishJerricco

Copy link
Copy Markdown
Contributor

It's a little awkward that provision.conf has a line for /etc/hosts when NixOS will already be managing that as an environment.etc thing, but that should be harmless; the line will just be silently ignored. But yea we should probably remove the redundant SSH module code.

@flokli

flokli commented Aug 22, 2026

Copy link
Copy Markdown
Member

Ah thanks. I'll add a commit removing that snippet from the module! We shouldn't have the same code twice :)

@arianvp poke to push this ;-)

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Aug 23, 2026
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 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. 8.has: module (update) This PR changes an existing module in `nixos/` 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. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants