Skip to content

systemd domainname unit - use nix store path of net tools for domainname #264082

Merged
nikstur merged 1 commit intoNixOS:masterfrom
josephst:systemd-domainname
Oct 29, 2023
Merged

systemd domainname unit - use nix store path of net tools for domainname #264082
nikstur merged 1 commit intoNixOS:masterfrom
josephst:systemd-domainname

Conversation

@josephst
Copy link
Member

@josephst josephst commented Oct 29, 2023

Description of changes

Recent change to how domainname is set (going from activationScript to systemd unit) causes an error when trying to activate the systemd unit file - getting domainname.service: Failed at step EXEC spawning domainname: No such file or directory.

Fixed by adding full path to nettools to the command (ie serviceConfig.ExecStart = ''${pkgs.nettools}/bin/domainname "${cfg.domain}"'';). Suspect this may be an issue in some other places where activationScripts (which seem to inherit the system's installed packages) have been replaced with systemd unit files (which are isolated and do not inherit from $PATH or installed packages)

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/)
  • 23.11 Release Notes (or backporting 23.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.

@github-actions github-actions bot added 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 Oct 29, 2023
@josephst josephst requested a review from nikstur October 29, 2023 02:41
@ofborg ofborg bot added 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. labels Oct 29, 2023
@nikstur nikstur merged commit 7cb1ab9 into NixOS:master Oct 29, 2023
@nikstur
Copy link
Contributor

nikstur commented Oct 29, 2023

Thank you!

@josephst josephst deleted the systemd-domainname branch October 29, 2023 16:29
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: 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