Compare commits

..

2 commits

Author SHA1 Message Date
ec980bd86e fixup! Use specific git forgejo CI
All checks were successful
CI / build (push) Successful in 13m56s
2024-10-03 14:29:08 +03:00
6bbd0f0157 Use specific git forgejo CI
Some checks failed
CI / build (push) Failing after 0s
2024-10-03 14:18:31 +03:00
3 changed files with 27 additions and 9 deletions

View file

@ -8,7 +8,8 @@ env:
jobs: jobs:
build: build:
runs-on: nix runs-on: docker
container: nixpkgs/nix-flakes:nixos-24.05
steps: steps:
- name: Initialize CI - name: Initialize CI
uses: https://git.qo.is/qo.is/actions-nix-init@main uses: https://git.qo.is/qo.is/actions-nix-init@main

View file

@ -78,6 +78,16 @@
''; '';
}; };
system.autoUpgrade = {
enable = true;
randomizedDelaySec = "30m";
flags = [
"--update-input"
"nixpkgs-nixos-2211"
"--commit-lock-file"
];
};
# Network services # Network services
networking.firewall = { networking.firewall = {
allowPing = true; allowPing = true;

View file

@ -32,8 +32,7 @@ with lib;
sops.secrets."forgejo/runner-registration-token".restartUnits = [ sops.secrets."forgejo/runner-registration-token".restartUnits = [
"gitea-runner-${defaultInstanceName}.service" "gitea-runner-${defaultInstanceName}.service"
] ++genAttrs (genList (n: "gitea-runner-nix${builtins.toString n}.service") cfg.nixInstances) ];
;
virtualisation.podman = { virtualisation.podman = {
enable = true; enable = true;
@ -61,6 +60,7 @@ with lib;
capacity = 30; capacity = 30;
}; };
cache.enable = true; # TODO: This should probably be a central cache server? cache.enable = true; # TODO: This should probably be a central cache server?
# the default network that also respects our dns server settings
container.network = "host"; container.network = "host";
}; };
}; };
@ -142,10 +142,17 @@ with lib;
storage.runroot = "/run/containers/storage"; storage.runroot = "/run/containers/storage";
}; };
#virtualisation.containers.containersConf.settings = {
# # podman seems to not work with systemd-resolved
# containers.dns_servers = [
# "8.8.8.8"
# "8.8.4.4"
# ];
#};
} }
{ {
systemd.services = systemd.services =
genAttrs (genList (n: "gitea-runner-nix${builtins.toString n}") cfg.nixInstances) genAttrs (builtins.genList (n: "gitea-runner-nix${builtins.toString n}") cfg.nixInstances)
(name: { (name: {
after = [ after = [
"gitea-runner-nix-image.service" "gitea-runner-nix-image.service"
@ -232,16 +239,15 @@ with lib;
mkdir -p $out/bin mkdir -p $out/bin
for dir in ${ for dir in ${
toString [ toString [
pkgs.bash
pkgs.coreutils pkgs.coreutils
pkgs.findutils pkgs.findutils
pkgs.gnugrep
pkgs.gawk pkgs.gawk
pkgs.git pkgs.git
pkgs.gnugrep
pkgs.jq
pkgs.nix pkgs.nix
pkgs.bash
pkgs.jq
pkgs.nodejs pkgs.nodejs
pkgs.openssh
] ]
}; do }; do
for bin in "$dir"/bin/*; do for bin in "$dir"/bin/*; do
@ -254,7 +260,7 @@ with lib;
cp -a "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" $out/etc/ssl/certs/ca-bundle.crt cp -a "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" $out/etc/ssl/certs/ca-bundle.crt
''; '';
in in
genAttrs (genList (n: "nix${builtins.toString n}") cfg.nixInstances) (name: { genAttrs (builtins.genList (n: "nix${builtins.toString n}") cfg.nixInstances) (name: {
enable = true; enable = true;
name = "${config.networking.hostName}-${name}"; name = "${config.networking.hostName}-${name}";
url = "https://${cfg.domain}"; url = "https://${cfg.domain}";
@ -262,6 +268,7 @@ with lib;
labels = [ "nix:docker://gitea-runner-nix" ]; labels = [ "nix:docker://gitea-runner-nix" ];
settings = { settings = {
container.options = "-e NIX_BUILD_SHELL=/bin/bash -e PAGER=cat -e PATH=/bin -e SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt --device /dev/kvm -v /nix:/nix -v ${storeDeps}/bin:/bin -v ${storeDeps}/etc/ssl:/etc/ssl --user nixuser --device=/dev/kvm"; container.options = "-e NIX_BUILD_SHELL=/bin/bash -e PAGER=cat -e PATH=/bin -e SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt --device /dev/kvm -v /nix:/nix -v ${storeDeps}/bin:/bin -v ${storeDeps}/etc/ssl:/etc/ssl --user nixuser --device=/dev/kvm";
# the default network that also respects our dns server settings
container.network = "host"; container.network = "host";
container.valid_volumes = [ container.valid_volumes = [
"/nix" "/nix"