This commit is contained in:
Andrea Ciceri 2023-04-17 18:12:52 +02:00
parent 893480e3e3
commit 9771b35612
Signed by: aciceri
SSH key fingerprint: SHA256:/AagBweyV4Hlfg9u092n8hbHwD5fcB6A3qhDiDA65Rg
15 changed files with 388 additions and 42 deletions

View file

@ -40,9 +40,6 @@ in {
};
forceSSL = true;
enableACME = true;
# locations."/" = {
# proxyPass = "http://127.0.0.1:${builtins.toString config.services.hydra.port}";
# };
};
systemd.services.cgit-setup-repos = {
@ -54,4 +51,13 @@ in {
wantedBy = ["multi-user.target"];
script = builtins.toString cgit-setup-repos;
};
systemd.timers.cgit-setup-repos = {
wantedBy = ["timers.target"];
partOf = ["cgit-setup-repos.service"];
timerConfig = {
OnCalendar = "*-*-* 4:00:00"; # daily at 4 AM
Unit = "cgit-setup-repos.service";
};
};
}

View file

@ -104,11 +104,10 @@ in {
allowed-uris = https://github.com/ git://git.savannah.gnu.org/ https://git.sr.ht
'';
services.hydra = {
services.hydra-dev = {
enable = true;
hydraURL = "https://${cfg.domain}";
notificationSender = "hydra@mothership.fleet";
buildMachinesFiles = [];
useSubstitutes = true;
extraConfig =
''
@ -148,6 +147,14 @@ in {
touch ~hydra/.setup-is-complete
fi
mkdir -p /var/lib/hydra/.ssh
cp /home/ccr/.ssh/id_rsa* /var/lib/hydra/.ssh/
chown -R hydra:hydra /var/lib/hydra/.ssh
mkdir -p /var/lib/hydra/queue-runner/.ssh
cp /home/ccr/.ssh/id_rsa* /var/lib/hydra/queue-runner/.ssh/
chown -R hydra-queue-runner:hydra /var/lib/hydra/queue-runner/.ssh
curl --head -X GET --retry 5 --retry-connrefused --retry-delay 1 http://localhost:3000
CURRENT_REPOS=$(curl -s -H "Accept: application/json" http://localhost:3000 | yq ".[].name")

View file

@ -0,0 +1,3 @@
{
programs.hyprland.enable = true;
}

View file

@ -44,10 +44,11 @@
hostName = "rock5b.fleet";
system = "aarch64-linux";
maxJobs = 6;
speedFactor = 2;
speedFactor = 1;
supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm"];
mandatoryFeatures = [];
sshKey = "/etc/ssh/ssh_host_ed25519_key";
sshKey = "/var/lib/hydra/queue-runner/.ssh/id_rsa";
sshUser = "root";
}
];
distributedBuilds = true;

View file

@ -0,0 +1,49 @@
{
pkgs,
lib,
fleetFlake,
...
}: {
security.polkit.enable = true;
virtualisation.libvirtd.enable = true;
networking.firewall.interfaces."wg0".allowedTCPPorts = [
5900 # vnc by QEMU
3389 # rdp installed in Windows itself
];
boot.kernelParams = [
"intel_iommu=on"
"iommu=pt"
];
systemd.services.vm-mara = let
start-vm = pkgs.writeShellApplication {
name = "start-vm";
runtimeInputs = with pkgs; [qemu];
text = ''
[ ! -f /var/lib/vm-mara/w10.qcow2 ] && \
qemu-img create -f qcow2 /var/lib/vm-mara/w10.qcow2 50G
qemu-system-x86_64 \
-enable-kvm \
-cpu host \
-smp 2 \
-m 4096 \
-nic user,model=virtio-net-pci,hostfwd=tcp::3389-:3389 \
-vnc :0 \
-cdrom /var/lib/vm-mara/virtio-win.iso \
-device nec-usb-xhci,id=usb,bus=pci.0,addr=0x4 \
-device usb-tablet \
-audiodev alsa,id=snd0,out.try-poll=off -device ich9-intel-hda -device hda-output,audiodev=snd0 \
-drive file=/var/lib/vm-mara/w10.qcow2
'';
};
in {
wantedBy = ["multi-user.target"];
after = ["network.target"];
serviceConfig = {
ExecStart = "${start-vm}/bin/start-vm";
};
};
}