diff options
author | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2012-03-21 20:37:37 +0000 |
---|---|---|
committer | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2012-03-21 20:37:37 +0000 |
commit | 5ddae4a83afacd2fabc69f965cdaa7bd04c3f1c5 (patch) | |
tree | 2ffb43029fb4b80efd7fb5f23a4247d9dfe2afec /modules/services/networking/rpcbind.nix | |
parent | a4a355f76403d6e04392738c710623afbc663266 (diff) | |
download | nixpkgs-5ddae4a83afacd2fabc69f965cdaa7bd04c3f1c5.tar nixpkgs-5ddae4a83afacd2fabc69f965cdaa7bd04c3f1c5.tar.gz nixpkgs-5ddae4a83afacd2fabc69f965cdaa7bd04c3f1c5.tar.bz2 nixpkgs-5ddae4a83afacd2fabc69f965cdaa7bd04c3f1c5.tar.lz nixpkgs-5ddae4a83afacd2fabc69f965cdaa7bd04c3f1c5.tar.xz nixpkgs-5ddae4a83afacd2fabc69f965cdaa7bd04c3f1c5.tar.zst nixpkgs-5ddae4a83afacd2fabc69f965cdaa7bd04c3f1c5.zip |
Changing portmap by rpcbind on nfs services.
That could make rpc.statd work. Patch by Rickard Nilsson. I'm not sure we need that netconfig file in etc. svn path=/nixos/trunk/; revision=33342
Diffstat (limited to 'modules/services/networking/rpcbind.nix')
-rw-r--r-- | modules/services/networking/rpcbind.nix | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/modules/services/networking/rpcbind.nix b/modules/services/networking/rpcbind.nix new file mode 100644 index 00000000000..5437d221c1e --- /dev/null +++ b/modules/services/networking/rpcbind.nix @@ -0,0 +1,80 @@ +{ config, pkgs, ... }: + +with pkgs.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 + + options = { + + services.rpcbind = { + + enable = mkOption { + 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.etc = [netconfigFile]; + + jobs.rpcbind = + { description = "ONC RPC rpcbind"; + + startOn = "started network-interfaces"; + stopOn = ""; + + daemonType = "fork"; + + exec = + '' + ${pkgs.rpcbind}/bin/rpcbind + ''; + }; + + }; + +} |