Skip to content

Set up a Nix builder #15

@Frontear

Description

@Frontear

Extremely low priority. This issue is largely being made to document the process so that I do not need to stumble around in documentation hell.

  1. Generate an ssh key on the local machine, send the public part to the remote machine (via users.users.<name>.openssh.authorizedKeys.keys/keyFiles).
  2. Create a /root/.ssh/config on the local machine that contains this minimum snippet
Host REMOTE-BUILDER
  IdentitiesOnly yes
  IdentityFile /root/.ssh/key
  User <builder-user>
  1. Create a build user on the remote machine via this minimal snippet
services.openssh.enable = true;

users.users.builder = {
  isNormalUser = true;
  group = "builder";

  openssh.authorizedKeys.key/keyFiles = [ ... ];
};

users.groups.builder = {};

nix.settings.trusted-users = [ "builder" ];
  1. On the local machine, use this configuration to attach the builder
nix.distributedBuilds = true;
nix.buildMachines = [{
  hostName = "REMOTE-BUILDER";
  sshUser = "builder";
  sshKey = "/root/.ssh/key";
  system = " ... ";
  supportedFeatures = [ ... ];
  ... # THIS IS BARE MINIMUM
}];

That's it. What a disgustingly annoying set of tips, full of imperative behaviour too. Ideally I want to set this up behind a module and in a significantly saner way, sometime in the near future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compat: backwardsRepresents a backwards compatible change. Existing functionality is wholly unaffected by changes.priority: lowNon-essential issues that are neither affecting functionality nor usability.type: feature/additionMarks the request/implementation of a feature addition. Accompany with relevant labels.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions