ci: move all the job scheduling to the ci module, add an update task

- run a build every hour
- run an update daily
This commit is contained in:
Aaron Bieber 2023-02-02 11:49:18 -07:00
parent a6e80a224f
commit 9782963437
No known key found for this signature in database
2 changed files with 20 additions and 14 deletions

View File

@ -1,5 +1,20 @@
{ config, lib, pkgs, inputs, ... }: { config, lib, pkgs, inputs, xinlib, ... }:
with lib; { let
jobs = [
{
name = "xin-ci-update";
script = "cd ~/src/xin && ./ci update";
startAt = "daily";
path = [ ];
}
{
name = "xin-ci";
script = "cd ~/src/xin && ./ci";
startAt = "hourly";
path = [ ];
}
];
in with lib; {
options = { options = {
xinCI = { xinCI = {
enable = mkEnableOption "Configure host as a xin CI host."; enable = mkEnableOption "Configure host as a xin CI host.";
@ -47,9 +62,9 @@ with lib; {
settings.allowed-users = [ "root" config.xinCI.user "nix-serve" ]; settings.allowed-users = [ "root" config.xinCI.user "nix-serve" ];
}; };
# TODOs systemd.user.services =
# - Service to fire off ./ci lib.listToAttrs (builtins.map xinlib.jobToService jobs);
# - Git config for signing
services = { services = {
tsrevprox = { tsrevprox = {
enable = true; enable = true;

View File

@ -5,12 +5,6 @@ let
pubKeys = [ pubKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO7v+/xS8832iMqJHCWsxUZ8zYoMWoZhjj++e26g1fLT europa" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO7v+/xS8832iMqJHCWsxUZ8zYoMWoZhjj++e26g1fLT europa"
]; ];
jobs = [{
name = "xin-ci";
script = "cd ~/src/xin && ./ci update";
startAt = "daily";
path = [ ];
}];
in { in {
_module.args.isUnstable = true; _module.args.isUnstable = true;
imports = [ ./hardware-configuration.nix ]; imports = [ ./hardware-configuration.nix ];
@ -21,9 +15,6 @@ in {
boot.loader.efi.efiSysMountPoint = "/boot/efi"; boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
systemd.user.services =
lib.listToAttrs (builtins.map xinlib.jobToService jobs);
networking = { networking = {
hostName = "pwntie"; hostName = "pwntie";
networkmanager.enable = true; networkmanager.enable = true;