181 lines
4.4 KiB
Nix
181 lines
4.4 KiB
Nix
{ config, pkgs, ... }:
|
||
|
||
{
|
||
imports =
|
||
[ # Include the results of the hardware scan.
|
||
./hardware-configuration.nix
|
||
];
|
||
|
||
# Bootloader.
|
||
boot = {
|
||
loader ={
|
||
systemd-boot.enable = true;
|
||
efi.canTouchEfiVariables = true;
|
||
};
|
||
kernelPackages = pkgs.linuxPackages_latest;
|
||
};
|
||
|
||
|
||
networking = {
|
||
hostName = "gitea"; # Define your hostname.
|
||
networkmanager.enable = true;
|
||
};
|
||
|
||
# Set your time zone.
|
||
time.timeZone = "Europe/Zurich";
|
||
|
||
system.autoUpgrade = {
|
||
enable = true;
|
||
allowReboot = true;
|
||
rebootWindow = {
|
||
lower = "01:00";
|
||
upper = "03:00";
|
||
};
|
||
};
|
||
|
||
# Select internationalisation properties.
|
||
i18n.defaultLocale = "en_US.UTF-8";
|
||
|
||
# Configure keymap in X11
|
||
services.xserver.xkb = {
|
||
layout = "ch";
|
||
variant = "";
|
||
};
|
||
|
||
# Configure console keymap
|
||
console.keyMap = "sg";
|
||
|
||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||
users.users = {
|
||
tte = {
|
||
isNormalUser = true;
|
||
description = "tte";
|
||
extraGroups = [ "networkmanager" "wheel" "docker" ];
|
||
packages = with pkgs; [];
|
||
};
|
||
gitea.extraGroups = [ "docker" ];
|
||
};
|
||
|
||
# Allow unfree packages
|
||
nixpkgs.config.allowUnfree = true;
|
||
|
||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||
|
||
# List packages installed in system profile.
|
||
environment.systemPackages = with pkgs; [
|
||
vim
|
||
wget
|
||
tmux
|
||
curl
|
||
ethtool
|
||
git
|
||
gitea
|
||
# nginx
|
||
fastfetch
|
||
];
|
||
|
||
# List services that you want to enable:
|
||
|
||
# Enable the OpenSSH daemon.
|
||
services = {
|
||
openssh.enable = true;
|
||
nginx = {
|
||
enable = false;
|
||
};
|
||
qemuGuest.enable = true;
|
||
gitea = {
|
||
enable = true;
|
||
appName = "Gh0st's git";
|
||
settings = {
|
||
"git.timeout" = {
|
||
# "DEFAULT = 360"
|
||
MIGRATE = 6000;
|
||
# "MIRROR = 300"
|
||
# "CLONE = 300"
|
||
# "PULL = 300"
|
||
# "GC = 60"
|
||
};
|
||
};
|
||
settings.server = {
|
||
DOMAIN = "git.blubb.fish";
|
||
ROOT_URL = "https://git.blubb.fish";
|
||
SSH_PORT = 2222;
|
||
};
|
||
};
|
||
};
|
||
|
||
# services.nginx.virtualHosts."git.blubb.fish" = {
|
||
# addSSL = true;
|
||
# sslCertificate = /cert/git.blubb.fish/cert.pem;
|
||
# sslCertificateKey = /cert/git.blubb.fish/key.pem;
|
||
# sslTrustedCertificate = /cert/git.blubb.fish/fullchain.pem;
|
||
# locations."/".proxyPass = "http://127.0.0.1:3000/";
|
||
# };
|
||
|
||
virtualisation = {
|
||
docker = {
|
||
enable = true;
|
||
rootless = {
|
||
enable = true;
|
||
setSocketVariable = true;
|
||
};
|
||
};
|
||
oci-containers.containers = {
|
||
act_runner_01 = {
|
||
image = "gitea/act_runner";
|
||
environment = {
|
||
GITEA_INSTANCE_URL = "http://10.0.0.24:3000";
|
||
GITEA_RUNNER_REGISTRATION_TOKEN = "GPf0fQ10T56S5UMb8Mrr7674V1VWjOQaDDuo1CRQ";
|
||
GITEA_RUNNER_NAME = "runner01";
|
||
GITEA_RUNNER_LABELS = "ubuntu-latest:docker://node:16-bullseye,ubuntu-22.04:docker://node:16-bullseye,ubuntu-20.04:docker://node:16-bullseye,ubuntu-18.04:docker://node:16-buster";
|
||
};
|
||
volumes = [
|
||
"/root/docker/runner01/data:/data"
|
||
"/var/run/docker.sock:/var/run/docker.sock"
|
||
];
|
||
};
|
||
act_runner_02 = {
|
||
image = "gitea/act_runner";
|
||
environment = {
|
||
GITEA_INSTANCE_URL = "http://10.0.0.24:3000";
|
||
GITEA_RUNNER_REGISTRATION_TOKEN = "GPf0fQ10T56S5UMb8Mrr7674V1VWjOQaDDuo1CRQ";
|
||
GITEA_RUNNER_NAME = "runner02";
|
||
GITEA_RUNNER_LABELS = "ubuntu-latest:docker://node:16-bullseye,ubuntu-22.04:docker://node:16-bullseye,ubuntu-20.04:docker://node:16-bullseye,ubuntu-18.04:docker://node:16-buster";
|
||
};
|
||
volumes = [
|
||
"/root/docker/runner02/data:/data"
|
||
"/var/run/docker.sock:/var/run/docker.sock"
|
||
];
|
||
};
|
||
};
|
||
};
|
||
|
||
systemd = {
|
||
timers."start-runner" = {
|
||
wantedBy = [ "timers.target" ];
|
||
timerConfig = {
|
||
OnCalendar = "daily";
|
||
Persistent = true;
|
||
Unit = "start-runner.service";
|
||
};
|
||
};
|
||
services."start-runner" = {
|
||
script = ''
|
||
/root/runner/act_runner daemon &
|
||
'';
|
||
serviceConfig = {
|
||
Type = "oneshot";
|
||
User = "root";
|
||
};
|
||
};
|
||
};
|
||
|
||
# Open ports in the firewall.
|
||
networking.firewall.allowedTCPPorts = [ 22 3000 ];
|
||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||
|
||
# just leave forever
|
||
system.stateVersion = "24.05"; # Did you read the comment?
|
||
|
||
}
|