mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 23:23:07 +00:00
6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
57 lines
1.4 KiB
Nix
57 lines
1.4 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.rpcbind = {
|
|
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = ''
|
|
Whether to enable `rpcbind`, an ONC RPC directory service
|
|
notably used by NFS and NIS, and which can be queried
|
|
using the rpcinfo(1) command. `rpcbind` is a replacement for
|
|
`portmap`.
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf config.services.rpcbind.enable {
|
|
environment.systemPackages = [ pkgs.rpcbind ];
|
|
|
|
systemd.packages = [ pkgs.rpcbind ];
|
|
|
|
systemd.services.rpcbind = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
# rpcbind performs a check for /var/run/rpcbind.lock at startup
|
|
# and will crash if /var/run isn't present. In the stock NixOS
|
|
# var.conf tmpfiles configuration file, /var/run is symlinked to
|
|
# /run, so rpcbind can enter a race condition in which /var/run
|
|
# isn't symlinked yet but tries to interact with the path, so
|
|
# controlling the order explicitly here ensures that rpcbind can
|
|
# start successfully. The `wants` instead of `requires` should
|
|
# avoid creating a strict/brittle dependency.
|
|
wants = [ "systemd-tmpfiles-setup.service" ];
|
|
after = [ "systemd-tmpfiles-setup.service" ];
|
|
};
|
|
|
|
users.users.rpc = {
|
|
group = "nogroup";
|
|
uid = config.ids.uids.rpc;
|
|
};
|
|
};
|
|
|
|
}
|