add hostnames, remove refs
All checks were successful
Check flake.lock / Check health of `flake.lock` (pull_request) Successful in 8s
Check Nix flake / Perform Nix flake checks (pull_request) Successful in 3m4s

This commit is contained in:
2025-12-21 22:57:28 -05:00
parent 726f9401cd
commit f08d7ac1d2
2 changed files with 24 additions and 16 deletions

View File

@@ -18,7 +18,7 @@ let
};
prs = readJSONFile pulls;
refs = readJSONFile branches;
#refs = readJSONFile branches;
# template for creating a job
makeJob =
@@ -47,19 +47,19 @@ let
giteaHost = "ssh://gitea@nayeonie.com:2222";
repo = "ahuston-0/nix-dotfiles";
# # Create a hydra job for a branch
jobOfRef =
name:
{ ref, ... }:
if ((builtins.match "^refs/heads/(.*)$" ref) == null) then
null
else
{
name = builtins.replaceStrings [ "/" ] [ "-" ] "branch-${name}";
value = makeJob {
description = "Branch ${name}";
flake = "git+${giteaHost}/${repo}?ref=${ref}";
};
};
#jobOfRef =
# name:
# { ref, ... }:
# if ((builtins.match "^refs/heads/(.*)$" ref) == null) then
# null
# else
# {
# name = builtins.replaceStrings [ "/" ] [ "-" ] "branch-${name}";
# value = makeJob {
# description = "Branch ${name}";
# flake = "git+${giteaHost}/${repo}?ref=${ref}";
# };
# };
# Create a hydra job for a PR
jobOfPR = id: info: {
@@ -77,12 +77,12 @@ let
# wrapper function for reading json from file
readJSONFile = f: builtins.fromJSON (builtins.readFile f);
# remove null values from a set, in-case of branches that don't exist
mapFilter = f: l: builtins.filter (x: (x != null)) (map f l);
#mapFilter = f: l: builtins.filter (x: (x != null)) (map f l);
# Create job set from PRs and branches
jobs = makeSpec (
builtins.listToAttrs (map ({ name, value }: jobOfPR name value) (attrsToList prs))
// builtins.listToAttrs (mapFilter ({ name, value }: jobOfRef name value) (attrsToList refs))
#// builtins.listToAttrs (mapFilter ({ name, value }: jobOfRef name value) (attrsToList refs))
);
in
{