Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions modules/machines/nixos/magnetite/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,17 @@ in
users.users.builder = {
isNormalUser = true;
description = "Remote nix build user";
openssh.authorizedKeys.keys = inputs.self.users.crs58.meta.sshKeys ++ [
inputs.self.darwinConfigurations.stibnite.config.clan.core.vars.generators.nix-remote-build.files."key.pub".value
# nix-daemon --stdio is exactly what an ssh-ng caller would otherwise
# invoke (`remote-program` defaults to nix-daemon), so forcing it serves
# the build protocol and discards anything else the client asks for.
# sshd runs the forced command through the account's login shell, so the
# shell must stay executable; a nologin shell would break the protocol
# rather than harden it. Mirrors the stibnite direction of this pair.
openssh.authorizedKeys.keys = [
''restrict,command="${config.nix.package}/bin/nix-daemon --stdio" ${
lib.removeSuffix "\n"
inputs.self.darwinConfigurations.stibnite.config.clan.core.vars.generators.nix-remote-build.files."key.pub".value
}''
];
};

Expand Down