diff options
author | Yegor Timoshenko <yegortimoshenko@transumption.com> | 2019-06-15 10:37:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-15 10:37:35 +0300 |
commit | d089f233905578359b73b0691cf3faa8362dd927 (patch) | |
tree | 681eed8aa54c13f5d13a8ad5672099d8be635e27 /nixos/modules | |
parent | 3ac9699ae2cc8f8238bcd8533497676074a69d3e (diff) | |
parent | 861bbbcb3c406f4a5a7131e48f2621431514c91e (diff) |
Merge pull request #62853 from samueldr/fix/sshd-cross-compile-issue
nixos/sshd: fixes validation for cross-compilation
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/networking/ssh/sshd.nix | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index 89f56a726f46..0f9d2420903b 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -4,7 +4,15 @@ with lib; let - sshconf = pkgs.runCommand "sshd.conf-validated" { nativeBuildInputs = [ cfgc.package ]; } '' + # The splicing information needed for nativeBuildInputs isn't available + # on the derivations likely to be used as `cfgc.package`. + # This middle-ground solution ensures *an* sshd can do their basic validation + # on the configuration. + validationPackage = if pkgs.stdenv.buildPlatform == pkgs.stdenv.hostPlatform + then [ cfgc.package ] + else [ pkgs.buildPackages.openssh ]; + + sshconf = pkgs.runCommand "sshd.conf-validated" { nativeBuildInputs = [ validationPackage ]; } '' cat >$out <<EOL ${cfg.extraConfig} EOL |