File tree Expand file tree Collapse file tree 7 files changed +59
-0
lines changed Expand file tree Collapse file tree 7 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 166
166
passwordAuthentication = false ;
167
167
extraConfig = ''
168
168
AllowUsers backup git bf
169
+ # For nix remote / distributed builds
170
+ AllowUsers nix-remote-build
169
171
170
172
# Doesn't work on NixOS: https://github.com/NixOS/nixpkgs/issues/18503
171
173
## Allow password authentication (only) from local network
Original file line number Diff line number Diff line change
1
+ {
2
+ nix . buildMachines = [
3
+ { hostName = "bforsman.name" ;
4
+ systems = [ "x86_64-linux" ] ;
5
+ # TODO: I belive maxJobs = "auto" is documented somewhere, but nix-2.2.2
6
+ # and 2.3 fail with unhelpful "error: stoull".
7
+ maxJobs = 4 ;
8
+ speedFactor = 10 ;
9
+ supportedFeatures = [
10
+ "benchmark"
11
+ "big-parallel"
12
+ "kvm"
13
+ "nixos-test"
14
+ ] ;
15
+ mandatoryFeatures = [ ] ;
16
+ # The server side user to login with
17
+ sshUser = "nix-remote-build" ;
18
+ # The client side private key for login as sshUser
19
+ sshKey = "/root/.ssh/id_ed25519_nix_remote_build" ;
20
+ }
21
+ ] ;
22
+ nix . distributedBuilds = true ;
23
+
24
+ # optional, useful when the builder has a faster internet connection than yours
25
+ nix . extraOptions = ''
26
+ builders-use-substitutes = true
27
+ '' ;
28
+ }
Original file line number Diff line number Diff line change
1
+ # TODO: There is a nix.sshServe NixOS option, but it doesn't (yet) allow the
2
+ # configuration of the nix-store --write flag.
3
+
4
+ let
5
+ user = "nix-remote-build" ;
6
+ in
7
+ {
8
+ # must be trusted to be allowed to build derivations
9
+ nix . trustedUsers = [ user ] ;
10
+
11
+ users . users . nix-remote-build = {
12
+ group = user ;
13
+ isSystemUser = true ;
14
+ useDefaultShell = true ;
15
+ openssh . authorizedKeys . keys = with import ../misc/ssh-keys.nix ; [
16
+ ( ''command="nix-store --serve --write",restrict '' + media . root . nix_remote_build )
17
+ ( ''command="nix-store --serve --write",restrict '' + mini . root . nix_remote_build )
18
+ ( ''command="nix-store --serve --write",restrict '' + whitetip . root . nix_remote_build )
19
+ ] ;
20
+ } ;
21
+
22
+ users . groups . "${ user } " = { } ;
23
+ }
Original file line number Diff line number Diff line change 6
6
../../cfg/base-medium.nix
7
7
../../cfg/disable-suspend.nix
8
8
../../cfg/bcache.nix
9
+ ../../cfg/nix-remote-build-client.nix
9
10
] ;
10
11
11
12
# Use the systemd-boot EFI boot loader.
Original file line number Diff line number Diff line change 6
6
../../cfg/base-big.nix
7
7
../../cfg/clamav.nix
8
8
../../cfg/disable-suspend.nix
9
+ ../../cfg/nix-remote-build-client.nix
9
10
../../cfg/smart-daemon.nix
10
11
] ;
11
12
Original file line number Diff line number Diff line change 19
19
../../cfg/cgit.nix
20
20
../../cfg/git-daemon.nix
21
21
../../cfg/gitolite.nix
22
+ ../../cfg/nix-remote-build-server.nix
22
23
../../cfg/postfix.nix
23
24
../../cfg/smart-daemon.nix
24
25
../../cfg/swraid.nix
Original file line number Diff line number Diff line change 6
6
7
7
{
8
8
media . root . backup = ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJsLLEZxPtdFQJVqG8zOuBZTUYHhhh026F2BDsHXJXPW root@media (for backup automation)'' ;
9
+ media . root . nix_remote_build = ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILoDrnvYjSPBWVLgwmuVaOUTnNF1ASaO7Y+oej+6WRBm root@media (nix remote build)'' ;
9
10
10
11
mini . root . backup = ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPCwtdqwE2WLolrNQmf5M/DmzaKjG29yq0lr4WgUa2z7 root@mini (for backup automation)'' ;
12
+ mini . root . nix_remote_build = ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE62OwZK96RYNiHbVWpQR+aD98wJn9TFmjKTnCV9pv5k root@mini (nix remote build)'' ;
11
13
12
14
mini . bf . default = ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTl8tsKUmHqO5eJoPvAVSu5vm7Ibml9rYxAblTUU/dl+zip7RNfl178qaX4nwUHkI3qsITJ8yQr42iIanvIPpCvM5V4rYjDmD7R4R8wSvzsrxegipG+kXfItlgsmCIuNsYZNCPtxESsLMW6tuJBfFy8L0IGmwYXLNNj7NIsrI4ElOhmWHz+VppZU1R74IghC+ZWJkkqoc9Ayt17ezLfBPYYuoan60H2/KOBtJX5qjfdxGXF5H7Oa7SBE/0zZ5Eaq8MudM/7CClc2nA787xadp8O6aQoF/ZB27dwr3mK2IugYc7w2rDlT67iQHLT27LKMU74CY//xSqkGUZOyGDAN7B bf@mini'' ;
13
15
14
16
whitetip . bf . default = ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCfy7XFi35G277tbjGzFeFdbtz8c3b9dQcBpE9KlcVVKMG9mMzVQeLJkehqi/NGyzV7DcJgvFW0vFJaRbQbOVuIlnC3rCwO+NUJW+48aarnna1Izv6ihHp5vprYhZT9AANfUUsaCy5ZBVljlJ34S8gJNvmq7oogh9ioi9hE3LvdZMC0M6k2WZG5+lPlDWbNjuWlYF9e9XVJlopU+xfNy98u0djyBo2urkqtNT8vXu49JarKpxgi3tMDv2pZFNNICukWsg8EEH6YIhJjsiO0RdnanzO/yQK2/SQtq0GjnzEaRilAgiUnGHC7f7iOBeNhc+hUcKltBlWmPsF9ZV5txZDT bf@whitetip'' ;
17
+ whitetip . root . nix_remote_build = ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBOgHOn3+Sr8WUZQiEVN3NZ6nXOL1NPUSo2Sen+63G6j root@whitetip (nix remote build)'' ;
15
18
whitetip . root . backup = ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAMnppoIYKUmeW09hw2nEofL3aDL12T/P8P81HMnwPpE root@whitetip (for backup automation)'' ;
16
19
17
20
my_phone . user . default = ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDZ63+kGCJbSI8P8LThqXJHZdiGWHpR7K/NUkimWn+3r4y22JhuRLpUHnHRfvPm16HIbrVwrHbZ6vxqvxx7hP9UGRTdRT9HjOvVoOQGIYjRtjrRiMHE/DmrBxdQ5FtQVeARKcNCWYIlubtuxg1c6ZD0fScs5yWrlumblsQxJgqS5K6csyh9yZL8rtBC0VqkroynMoYONqTTAAnx6lg9X6t2FZ3SFqCZ5VYk9DkwLZNIrwwEF87tQSuCSTX8pKw9THP0H07pafR0hWwKHuhPqbK7qlE1ZXzVtbujg/GndLbjFFV7Lpkc5h5B+fC4VBAiaKG9DQSV5LNRjrolprQkijNiFNqojnsCSJVDHSercDSTLNsN2wNPKXUlzkNyWEnefvPFrW1vPBoTF8YrPICNOi8mGLkX+ygP0ROycuKupSqkfAjXqdabAnuHNZHI1gY9j4/qlK5YhgbOu1pWVe9xVKCEfR0MG/iTi83ExiDlkzGgOcFkiDoUaKF6HMM2w6u+pgwDSsP8jmHrUuGqib3mMm3M7VMoGvxQE+T8bQ53G1/z/FI3xITpnNUs61DtUxf6uSCYJFDE5vRYSAnPW9L7/dLo5klJbDbyGyHgneFeGb5gdQEqhUZHXHXwCPyH5fn2XLA6DErMGWAvEqNVs6p2XO54UY/HuKnjr1W8eMqLVMpvVw== My phone'' ;
You can’t perform that action at this time.
0 commit comments