@@ -63,9 +63,9 @@ In the NixOS configuration directory of the *remote machine*, create the file `r
6363``` {code-block} nix
6464{
6565 users.users.remotebuild = {
66- isNormalUser = true;
67- createHome = false;
66+ isSystemUser = true;
6867 group = "remotebuild";
68+ useDefaultShell = true;
6969
7070 openssh.authorizedKeys.keyFiles = [ ./remotebuild.pub ];
7171 };
@@ -106,12 +106,10 @@ On the *local machine*, run as `root`:
106106
107107``` shell-session
108108# ssh remotebuild@remotemachine -i /root/.ssh/remotebuild "echo hello"
109- Could not chdir to home directory /home/remotebuild: No such file or directory
110109hello
111110```
112111
113112If the ` hello ` message is visible, the authentication works.
114- The ` Could not chdir to ... ` message confirms that the remote user has no home directory.
115113
116114This test login also adds the host key of the remote builder to the ` /root/.ssh/known_hosts ` file of the local machine.
117115Future logins will not be interrupted by host key checks.
@@ -236,13 +234,13 @@ Activate the new configuration as `root`:
236234Try building a new derivation on the * local machine* :
237235
238236``` shell-session
239- $ nix-build --max-jobs 0 -E << EOF
237+ $ nix-build --max-jobs 0 -E "$(cat << EOF
240238(import <nixpkgs> {}).writeText "test" "$(date)"
241239EOF
240+ )"
242241this derivation will be built:
243242 /nix/store/9csjdxv6ir8ccnjl6ijs36izswjgchn0-test.drv
244243building '/nix/store/9csjdxv6ir8ccnjl6ijs36izswjgchn0-test.drv' on 'ssh://remotebuilder'...
245- Could not chdir to home directory /home/remotebuild: No such file or directory
246244copying 0 paths...
247245copying 1 paths...
248246copying path '/nix/store/hvj5vyg4723nly1qh5a8daifbi1yisb3-test' from 'ssh://remotebuilder'...
0 commit comments