rpcbind service: use upstream systemd unit

Changed files
+10 -44
nixos
modules
misc
services
networking
+2
nixos/modules/misc/ids.nix
···
gogs = 268;
pdns-recursor = 269;
kresd = 270;
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
···
couchpotato = 267;
gogs = 268;
kresd = 270;
# When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal
···
gogs = 268;
pdns-recursor = 269;
kresd = 270;
+
rpc = 271;
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
···
couchpotato = 267;
gogs = 268;
kresd = 270;
+
#rpc = 271; # unused
# When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal
+8 -44
nixos/modules/services/networking/rpcbind.nix
···
with lib;
-
let
-
-
netconfigFile = {
-
target = "netconfig";
-
source = pkgs.writeText "netconfig" ''
-
#
-
# The network configuration file. This file is currently only used in
-
# conjunction with the TI-RPC code in the libtirpc library.
-
#
-
# Entries consist of:
-
#
-
# <network_id> <semantics> <flags> <protofamily> <protoname> \
-
# <device> <nametoaddr_libs>
-
#
-
# The <device> and <nametoaddr_libs> fields are always empty in this
-
# implementation.
-
#
-
udp tpi_clts v inet udp - -
-
tcp tpi_cots_ord v inet tcp - -
-
udp6 tpi_clts v inet6 udp - -
-
tcp6 tpi_cots_ord v inet6 tcp - -
-
rawip tpi_raw - inet - - -
-
local tpi_cots_ord - loopback - - -
-
unix tpi_cots_ord - loopback - - -
-
'';
-
};
-
-
in
-
{
###### interface
···
###### implementation
config = mkIf config.services.rpcbind.enable {
-
environment.systemPackages = [ pkgs.rpcbind ];
-
environment.etc = [ netconfigFile ];
-
systemd.services.rpcbind =
-
{ description = "ONC RPC Directory Service";
-
wantedBy = [ "multi-user.target" ];
-
-
requires = [ "basic.target" ];
-
after = [ "basic.target" ];
-
-
unitConfig.DefaultDependencies = false; # don't stop during shutdown
-
-
serviceConfig.Type = "forking";
-
serviceConfig.ExecStart = "@${pkgs.rpcbind}/bin/rpcbind rpcbind";
-
};
-
};
}
···
with lib;
{
###### interface
···
###### implementation
config = mkIf config.services.rpcbind.enable {
environment.systemPackages = [ pkgs.rpcbind ];
+
systemd.packages = [ pkgs.rpcbind ];
+
systemd.services.rpcbind = {
+
wantedBy = [ "multi-user.target" ];
+
};
+
users.extraUsers.rpc = {
+
group = "nogroup";
+
uid = config.ids.uids.rpc;
+
};
};
}