Skip to content

Commit 0257ecb

Browse files
crasmMic92
authored andcommitted
distributed-builds: use system user and fix shell command
1 parent 541d1a6 commit 0257ecb

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

source/tutorials/nixos/distributed-builds-setup.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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
110109
hello
111110
```
112111

113112
If 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

116114
This test login also adds the host key of the remote builder to the `/root/.ssh/known_hosts` file of the local machine.
117115
Future logins will not be interrupted by host key checks.
@@ -236,13 +234,13 @@ Activate the new configuration as `root`:
236234
Try 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)"
241239
EOF
240+
)"
242241
this derivation will be built:
243242
/nix/store/9csjdxv6ir8ccnjl6ijs36izswjgchn0-test.drv
244243
building '/nix/store/9csjdxv6ir8ccnjl6ijs36izswjgchn0-test.drv' on 'ssh://remotebuilder'...
245-
Could not chdir to home directory /home/remotebuild: No such file or directory
246244
copying 0 paths...
247245
copying 1 paths...
248246
copying path '/nix/store/hvj5vyg4723nly1qh5a8daifbi1yisb3-test' from 'ssh://remotebuilder'...

0 commit comments

Comments
 (0)