feat: Builder config settable with options
This commit is contained in:
31
sw/builders/default.nix
Normal file
31
sw/builders/default.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
# ============================================================================
|
||||
# Builders Software Configuration
|
||||
# ============================================================================
|
||||
# Imports builder-specific programs and services (GitHub Actions runners, etc.)
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
lib.mkMerge [
|
||||
(import ./programs.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
inputs
|
||||
;
|
||||
})
|
||||
(import ./services.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
inputs
|
||||
;
|
||||
})
|
||||
]
|
||||
19
sw/builders/programs.nix
Normal file
19
sw/builders/programs.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.ugaif.sw;
|
||||
basePackages = with pkgs; [
|
||||
# Build-related packages can be added here if needed
|
||||
];
|
||||
in
|
||||
{
|
||||
environment.systemPackages = subtractLists cfg.excludePackages (basePackages ++ cfg.extraPackages);
|
||||
}
|
||||
24
sw/builders/services.nix
Normal file
24
sw/builders/services.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.ugaif.sw;
|
||||
builderCfg = cfg.builders;
|
||||
in
|
||||
mkIf builderCfg.githubRunner.enable {
|
||||
services.github-runners.${builderCfg.githubRunner.name} = {
|
||||
enable = true;
|
||||
url = builderCfg.githubRunner.url;
|
||||
tokenFile = builderCfg.githubRunner.tokenFile;
|
||||
extraLabels = builderCfg.githubRunner.extraLabels;
|
||||
user = builderCfg.githubRunner.user;
|
||||
workDir = builderCfg.githubRunner.workDir;
|
||||
replace = true;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user