Skip to content

Commit

Permalink
macos/ci: push something that works
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Feb 23, 2024
1 parent 6c0b333 commit 19d7522
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 10 deletions.
14 changes: 8 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
nixpkgs-match.url = "github:srid/nixpkgs-match";
nuenv.url = "github:DeterminateSystems/nuenv";
nixd.url = "github:nix-community/nixd";
nixci.url = "github:srid/nixci";
nixci.url = "github:srid/nixci/build-systems";
nix-browser.url = "github:juspay/nix-browser";
actual.url = "github:srid/actual";
actual.inputs.nixpkgs.follows = "nixpkgs";
Expand Down Expand Up @@ -87,7 +87,7 @@
services.tailscale.enable = true;
services.easy-github-runners = {
"srid/ema" = { };
"srid/emanote" = { };
# "srid/emanote" = { }; -- running on macOS
"srid/nixos-config" = { };
"srid/nixos-flake" = { };
"srid/haskell-flake" = { };
Expand Down
41 changes: 39 additions & 2 deletions systems/darwin/ci.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,44 @@
{ ... }:
{ pkgs, lib, ... }:

{
# TODO: GitHub Runners
# TODO: Refactor this into a module, like easy-github-runners.nix
services.github-runners =
let
srid = {
common = {
enable = true;
# TODO: Document instructions
# - chmod og-rwx; chown github-runner
# TODO: Use a secret manager. 1Password?
tokenFile = "/run/mykeys/gh-token-runner";
extraPackages = with pkgs; [
nixci
cachix
which
coreutils
];
};
repos = {
emanote = {
url = "https://github.com/srid/emanote";
num = 2;
};
};
};
in
lib.listToAttrs (lib.concatLists (lib.flip lib.mapAttrsToList srid.repos
(k: { url, num }:
lib.flip builtins.map (lib.range 1 num) (idx:
let
name = "${k}-${builtins.toString idx}";
value = srid.common // {
inherit url;
};
in
lib.nameValuePair (builtins.trace name name) value)
)));
users.knownGroups = [ "github-runner" ];
users.knownUsers = [ "github-runner" ];

# To build Linux derivations whilst on macOS.
#
Expand Down

0 comments on commit 19d7522

Please sign in to comment.