decouple nixos config

This commit is contained in:
Sridhar Ratnakumar 2024-02-01 04:08:38 -05:00
parent 727fa3119d
commit 9c392f468f

View file

@ -54,8 +54,21 @@ in
type = types.str;
default = "gh-selfhosted-tokens";
};
nixosConfig = lib.mkOption {
type = types.deferredModule;
description = ''
NixOS configuration for the GitHub Runner container
'';
default = { pkgs, ... }: {
nix.settings = {
experimental-features = "nix-command flakes repl-flake";
max-jobs = "auto";
};
};
};
runnerConfig = lib.mkOption {
type = types.lazyAttrsOf types.raw;
description = ''Configuration for the GitHub Runner'';
default = {
extraPackages = with pkgs; [
cachix
@ -104,12 +117,11 @@ in
};
config = { config, pkgs, ... }: {
system.stateVersion = "23.11";
imports = [ userModule ];
nix.settings = {
trusted-users = [ user ]; # for cachix
experimental-features = "nix-command flakes repl-flake";
max-jobs = "auto";
};
imports = [
userModule
cfg.nixosConfig
];
nix.settings.trusted-users = [ user ]; # for cachix
services.github-runners."${name}" = cfg.runnerConfig // {
enable = true;
inherit user tokenFile;