infra/nix/oracle-gitea-runner/configuration.nix

79 lines
1.7 KiB
Nix
Raw Normal View History

{
2024-02-05 13:13:44 +00:00
config,
pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware.nix
];
2023-11-07 12:33:12 +00:00
nixpkgs.config.allowUnfree = true;
2024-02-05 13:13:44 +00:00
nix.settings.experimental-features = ["nix-command" "flakes"];
boot.tmp.cleanOnBoot = true;
zramSwap.enable = true;
environment.systemPackages = with pkgs; [
vim
wget
git
htop
tailscale
];
services.gitea-actions-runner = {
2023-09-05 21:44:01 +01:00
package = pkgs.forgejo-actions-runner;
2023-07-19 11:59:28 +01:00
instances = {
oracle-arm = {
name = "oracle-arm";
enable = true;
labels = [
"debian-latest-arm:docker://node:18-bullseye"
];
2023-09-05 21:44:01 +01:00
url = "https://git.gmem.ca";
token = "dcSqNPRfeAFjAA2NUzZRbO4Q2k1L2WOOCAEAhPR4";
settings = {
cache.port = 4328;
};
};
};
2023-07-19 11:59:28 +01:00
};
programs.zsh.enable = true;
programs.fish.enable = true;
2024-02-05 13:13:44 +00:00
environment.shells = with pkgs; [zsh fish];
networking = {
2023-09-05 21:44:01 +01:00
hostName = "forgejo-action-runner";
domain = "gmem.ca";
2024-02-05 13:13:44 +00:00
nameservers = ["1.1.1.1" "1.0.0.1"];
firewall = {
trustedInterfaces = ["tailscale0"];
checkReversePath = "loose";
enable = true;
2024-02-05 13:13:44 +00:00
allowedTCPPorts = [22 80 443 4328];
allowedUDPPorts = [];
};
nftables.enable = true;
};
2024-02-05 13:13:44 +00:00
users.users = {
root.openssh.authorizedKeys.keys = let
authorizedKeys = pkgs.fetchurl {
url = "https://gmem.ca/ssh";
hash = "sha256-7PpFDgWVfp26c9PuW+2s3O8MBAODtHr4q7WU/l3BoG4=";
};
2024-02-05 13:13:44 +00:00
in
pkgs.lib.splitString "\n" (builtins.readFile
authorizedKeys);
};
virtualisation = {
docker = {
enable = true;
};
};
2024-02-05 13:13:44 +00:00
services.openssh.enable = true;
services.tailscale.enable = true;
2023-09-05 21:44:01 +01:00
system.stateVersion = "23.11";
}