mirror of
https://github.com/srid/nixos-config.git
synced 2026-02-23 05:15:19 +08:00
Setup distributed
This commit is contained in:
parent
3b4431b8c5
commit
cede676eb0
2 changed files with 34 additions and 1 deletions
|
|
@ -8,6 +8,25 @@
|
|||
../nix-darwin/zsh-completion-fix.nix
|
||||
];
|
||||
|
||||
# Github runner CI
|
||||
users = {
|
||||
knownUsers = [ "github-runner" ];
|
||||
forceRecreate = true;
|
||||
users.github-runner = {
|
||||
uid = 1009;
|
||||
description = "GitHub Runner";
|
||||
home = "/Users/github-runner";
|
||||
createHome = true;
|
||||
shell = pkgs.bashInteractive;
|
||||
# NOTE: Go to macOS Remote-Login settings and allow all users to ssh.
|
||||
openssh.authorizedKeys.keys = [
|
||||
# github-runner VM's /etc/ssh/ssh_host_ed25519_key.pub
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJUJvyuUnIs2q2TkJq29wqJ6HyOAeMmIK8PcH7xAlpVY root@github-runner"
|
||||
];
|
||||
};
|
||||
};
|
||||
nix.settings.trusted-users = [ "github-runner" ];
|
||||
|
||||
nixpkgs.hostPlatform = "aarch64-darwin";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
# - [x] Intial config
|
||||
# - [x] Colmena deploy, with keys from 1Password.
|
||||
# - [x] Github Runners
|
||||
# - [ ] Distributed builder to host (macOS)
|
||||
# - [x] Distributed builder to host (macOS)
|
||||
# - [x] Refactor, to allow multiple repos (then remove easy-github-runners.nix)
|
||||
# - [ ] Refactor into own dir
|
||||
{ flake, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
|
|
@ -29,6 +30,7 @@ let
|
|||
];
|
||||
url = "https://github.com/${user}/${repoName}";
|
||||
})));
|
||||
hostIP = "10.37.129.2"; # Find out using `ifconfig` on host, looking for bridge101
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
|
|
@ -62,4 +64,16 @@ in
|
|||
services.github-runners = mkPersonalRunners "srid" {
|
||||
perpetuum.num = 2;
|
||||
};
|
||||
|
||||
# macOS remote builder
|
||||
nix.distributedBuilds = true;
|
||||
nix.buildMachines = [{
|
||||
hostName = hostIP;
|
||||
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
||||
# supportedFeatures = [ "kvm" "benchmark" "big-parallel" ];
|
||||
maxJobs = 6; # 6 cores
|
||||
protocol = "ssh-ng";
|
||||
sshUser = user;
|
||||
sshKey = "/etc/ssh/ssh_host_ed25519_key";
|
||||
}];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue