nixpkgs/nixos/modules/services/misc/nix-ssh-serve.nix
Eelco Dolstra 3e9c2bf4b5 nix-ssh-serve.nix: Remove unnecessary check
ForceCommand ensures that we always run nix-store --serve, so there is
no need to check SSH_ORIGINAL_COMMAND.
2014-07-25 14:29:08 +02:00

37 lines
801 B
Nix

{ config, lib, pkgs, ... }:
with lib;
{
options = {
nix.sshServe = {
enable = mkOption {
description = "Whether to enable serving the Nix store as a binary cache via SSH.";
default = false;
type = types.bool;
};
};
};
config = mkIf config.nix.sshServe.enable {
users.extraUsers.nix-ssh = {
description = "Nix SSH substituter user";
uid = config.ids.uids.nix-ssh;
shell = pkgs.stdenv.shell;
};
services.openssh.enable = true;
services.openssh.extraConfig = ''
Match User nix-ssh
AllowAgentForwarding no
AllowTcpForwarding no
PermitTTY no
PermitTunnel no
X11Forwarding no
ForceCommand ${config.nix.package}/bin/nix-store --serve
Match All
'';
};
}