summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Wohlfahrt <kai.wohlfahrt@gmail.com>2019-11-27 21:01:34 +0000
committerKai Wohlfahrt <kai.wohlfahrt@gmail.com>2019-12-12 15:42:44 +0000
commitb1c10bc8b225beec0752f1b96acfa38a5f95cc92 (patch)
treeac017c2eeccab46d4142d428e9aa060b22f7d4f1
parent0dce66a6ec4efefa421e17de7fba433acf7cd6fd (diff)
nfs: set up request-key for id mapping
A patch is necessary upstream to support multiple configs via symlinks in /etc/request-key.d Once that is done, we can add support for CIFS as well
-rw-r--r--nixos/modules/tasks/filesystems/nfs.nix6
-rw-r--r--nixos/tests/nfs/kerberos.nix11
2 files changed, 8 insertions, 9 deletions
diff --git a/nixos/modules/tasks/filesystems/nfs.nix b/nixos/modules/tasks/filesystems/nfs.nix
index e0e8bb1f03de..ddcc0ed8f5a4 100644
--- a/nixos/modules/tasks/filesystems/nfs.nix
+++ b/nixos/modules/tasks/filesystems/nfs.nix
@@ -25,6 +25,9 @@ let
'';
nfsConfFile = pkgs.writeText "nfs.conf" cfg.extraConfig;
+ requestKeyConfFile = pkgs.writeText "request-key.conf" ''
+ create id_resolver * * ${pkgs.nfs-utils}/bin/nfsidmap -t 600 %k %d
+ '';
cfg = config.services.nfs;
@@ -57,9 +60,12 @@ in
systemd.packages = [ pkgs.nfs-utils ];
+ environment.systemPackages = [ pkgs.keyutils ];
+
environment.etc = {
"idmapd.conf".source = idmapdConfFile;
"nfs.conf".source = nfsConfFile;
+ "request-key.conf".source = requestKeyConfFile;
};
systemd.services.nfs-blkmap =
diff --git a/nixos/tests/nfs/kerberos.nix b/nixos/tests/nfs/kerberos.nix
index 1c45b6542fd1..1f2d0d453ea0 100644
--- a/nixos/tests/nfs/kerberos.nix
+++ b/nixos/tests/nfs/kerberos.nix
@@ -27,13 +27,6 @@ let
};
};
- environment = {
- etc."request-key.conf".text = ''
- create id_resolver * * ${pkgs.nfs-utils}/bin/nfsidmap -t 600 %k %d
- '';
- systemPackages = with pkgs; [ keyutils ];
- };
-
in
{
@@ -41,7 +34,7 @@ in
nodes = {
client = { lib, ... }:
- { inherit krb5 users environment;
+ { inherit krb5 users;
networking.extraHosts = hosts;
networking.domain = "nfs.test";
@@ -57,7 +50,7 @@ in
};
server = { lib, ...}:
- { inherit krb5 users environment;
+ { inherit krb5 users;
networking.extraHosts = hosts;
networking.domain = "nfs.test";