Skip to content

Commit 50b9cd2

Browse files
committed
add woodpecker to hyperion
1 parent 35ea806 commit 50b9cd2

6 files changed

Lines changed: 55 additions & 9 deletions

File tree

hosts/hyperion/configuration.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
flake.nixosModules.service-restic-rest
1414
flake.nixosModules.service-jellyfin
1515
flake.nixosModules.service-rqbit
16+
flake.nixosModules.service-woodpecker
1617
];
1718

1819
networking = {

modules/nixos/common/impermanence.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
"/var/lib/nixos" # uid and gid mappings
2020
"/var/log" # logs
2121
"/var/lib/docker" # docker rootful
22+
# sandboxed systemd services -> TODO: should be per service
23+
{
24+
directory = "/var/lib/private";
25+
mode = "0700";
26+
}
2227
];
2328
files = [
2429
"/etc/machine-id" # important, e.g. for journald

modules/nixos/service-factorio.nix

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,4 @@
88
};
99

1010
age.secrets.factorio.file = ../../secrets/factorio.age;
11-
12-
environment.persistence."/nix/persist" = {
13-
directories = [
14-
{
15-
directory = "/var/lib/private";
16-
mode = "0700";
17-
}
18-
];
19-
};
2011
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}: {
7+
services = {
8+
woodpecker-server = {
9+
enable = true;
10+
environmentFile = "${config.age.secrets.woodpecker.path}";
11+
environment = {
12+
WOODPECKER_ADMIN = "debugloop";
13+
WOODPECKER_HOST = "https://ci.danieln.de";
14+
15+
WOODPECKER_GITEA = "true";
16+
WOODPECKER_GITEA_URL = "https://codeberg.org";
17+
18+
WOODPECKER_SERVER_ADDR = "localhost:8082";
19+
};
20+
};
21+
woodpecker-agents.agents.local = {
22+
enable = true;
23+
environmentFile = ["${config.age.secrets.woodpecker.path}"];
24+
environment = {
25+
WOODPECKER_SERVER = "localhost:9000";
26+
WOODPECKER_BACKEND = "local";
27+
WOODPECKER_HEALTHCHECK_ADDR = "localhost:3004";
28+
};
29+
path = with pkgs; [
30+
git
31+
git-lfs
32+
bash
33+
curl
34+
jq
35+
nix
36+
];
37+
};
38+
};
39+
40+
# NOTE: Required by the .#update script specifically for inline sed replace.
41+
systemd.services.woodpecker-agent-local.serviceConfig.SystemCallFilter = ["@chown"];
42+
43+
age.secrets.woodpecker.file = ../../secrets/woodpecker.age;
44+
45+
services.caddy.virtualHosts."ci.danieln.de".extraConfig = ''
46+
reverse_proxy localhost:8082
47+
'';
48+
}

secrets/secrets.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ in {
1818
"miniflux.age".publicKeys = all;
1919
"factorio.age".publicKeys = all;
2020
"mullvad.conf.age".publicKeys = all;
21+
"woodpecker.age".publicKeys = all;
2122
}

secrets/woodpecker.age

883 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)