This commit is contained in:
parent
52c4cdb006
commit
d60113a6df
|
@ -4,7 +4,7 @@ let
|
||||||
inherit (self.packages.${pkgs.hostPlatform.system}) actions-runner;
|
inherit (self.packages.${pkgs.hostPlatform.system}) actions-runner;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
systemd.services.gitea-actions-runner-nix-image = {
|
systemd.services.gitea-runner-nix-image = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
script = ''
|
script = ''
|
||||||
${lib.getExe pkgs.podman} load --input=${actions-runner}
|
${lib.getExe pkgs.podman} load --input=${actions-runner}
|
||||||
|
@ -14,7 +14,7 @@ in
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
systemd.services.gitea-actions-runner-nix-token = {
|
systemd.services.gitea-runner-nix-token = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "gitea.service" ];
|
after = [ "gitea.service" ];
|
||||||
environment = {
|
environment = {
|
||||||
|
@ -41,15 +41,40 @@ in
|
||||||
|
|
||||||
systemd.services.gitea-runner-nix = {
|
systemd.services.gitea-runner-nix = {
|
||||||
after = [
|
after = [
|
||||||
"gitea-actions-runner-nix-token.service"
|
"gitea-runner-nix-token.service"
|
||||||
"gitea-actions-runner-nix-image.service"
|
"gitea-runner-nix-image.service"
|
||||||
];
|
];
|
||||||
requires = [
|
requires = [
|
||||||
"gitea-actions-runner-nix-token.service"
|
"gitea-runner-nix-token.service"
|
||||||
"gitea-actions-runner-nix-image.service"
|
"gitea-runner-nix-image.service"
|
||||||
];
|
];
|
||||||
|
# TODO: systemd confinment
|
||||||
|
#serviceConfig = {
|
||||||
|
# Environment = [
|
||||||
|
# "NIX_REMOTE=daemon"
|
||||||
|
# "PAGER=cat"
|
||||||
|
# ];
|
||||||
|
# BindPaths = [
|
||||||
|
# "/nix/var/nix/daemon-socket/socket"
|
||||||
|
# "/run/nscd/socket"
|
||||||
|
# "/var/lib/drone"
|
||||||
|
# ];
|
||||||
|
#};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#services.gitea-actions-runner.instances.nix-container = {
|
||||||
|
# enable = true;
|
||||||
|
# name = "nix-runner";
|
||||||
|
# # take the git root url from the gitea config
|
||||||
|
# # only possible if you've also configured your gitea though the same nix config
|
||||||
|
# # otherwise you need to set it manually
|
||||||
|
# url = config.services.gitea.settings.server.ROOT_URL;
|
||||||
|
# # use your favourite nix secret manager to get a path for this
|
||||||
|
# tokenFile = "/var/lib/gitea-actions-runner/token";
|
||||||
|
# labels = [
|
||||||
|
# "nix:docker://${actions-runner.imageName}"
|
||||||
|
# ];
|
||||||
|
#};
|
||||||
services.gitea-actions-runner.instances.nix = {
|
services.gitea-actions-runner.instances.nix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
name = "nix-runner";
|
name = "nix-runner";
|
||||||
|
@ -59,8 +84,22 @@ in
|
||||||
url = config.services.gitea.settings.server.ROOT_URL;
|
url = config.services.gitea.settings.server.ROOT_URL;
|
||||||
# use your favourite nix secret manager to get a path for this
|
# use your favourite nix secret manager to get a path for this
|
||||||
tokenFile = "/var/lib/gitea-actions-runner/token";
|
tokenFile = "/var/lib/gitea-actions-runner/token";
|
||||||
labels = [
|
labels = [ "native:host" ];
|
||||||
"nix:docker://${actions-runner.imageName}"
|
hostPackages = with pkgs; [
|
||||||
|
bash
|
||||||
|
coreutils
|
||||||
|
curl
|
||||||
|
gawk
|
||||||
|
gitMinimal
|
||||||
|
gnused
|
||||||
|
jq
|
||||||
|
nixUnstable
|
||||||
|
nodejs
|
||||||
|
wget
|
||||||
|
gnutar
|
||||||
|
bash
|
||||||
|
config.nix.package
|
||||||
|
gzip
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user