mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 15:04:59 +08:00
decouple nixos config
This commit is contained in:
parent
727fa3119d
commit
9c392f468f
1 changed files with 18 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue