174 lines
4.5 KiB
Nix
174 lines
4.5 KiB
Nix
# Edit this configuration file to define what should be installed on
|
||
# your system. Help is available in the configuration.nix(5) man page
|
||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||
|
||
{ config, pkgs, ... }:
|
||
|
||
{
|
||
imports =
|
||
[ # Include the results of the hardware scan.
|
||
./hardware-configuration.nix
|
||
];
|
||
|
||
# Bootloader.
|
||
boot.loader.systemd-boot.enable = true;
|
||
boot.loader.efi.canTouchEfiVariables = true;
|
||
|
||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||
|
||
networking.hostName = "gitea"; # Define your hostname.
|
||
|
||
# Enable networking
|
||
networking.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; [];
|
||
};
|
||
|
||
users.users.gitea.extraGroups = [ "docker" ];
|
||
|
||
# Allow unfree packages
|
||
nixpkgs.config.allowUnfree = true;
|
||
|
||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||
|
||
# List packages installed in system profile. To search, run:
|
||
# $ nix search wget
|
||
environment.systemPackages = with pkgs; [
|
||
vim
|
||
wget
|
||
tmux
|
||
curl
|
||
ethtool
|
||
git
|
||
gitea
|
||
nginx
|
||
];
|
||
|
||
# Some programs need SUID wrappers, can be configured further or are
|
||
# started in user sessions.
|
||
# programs.mtr.enable = true;
|
||
# programs.gnupg.agent = {
|
||
# enable = true;
|
||
# enableSSHSupport = true;
|
||
# };
|
||
|
||
# List services that you want to enable:
|
||
|
||
# Enable the OpenSSH daemon.
|
||
services.openssh.enable = true;
|
||
#services.gitea.enable = true;
|
||
services.nginx.enable = true;
|
||
|
||
services.gitea = {
|
||
enable = true;
|
||
appName = "Gh0st's git";
|
||
settings = {
|
||
# other = {
|
||
"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;
|
||
DISABLE_SSH = true;
|
||
};
|
||
};
|
||
|
||
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;
|
||
};
|
||
};
|
||
|
||
virtualisation.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";
|
||
};
|
||
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";
|
||
};
|
||
volumes = [
|
||
"/root/docker/runner02/data:/data"
|
||
"/var/run/docker.sock:/var/run/docker.sock"
|
||
];
|
||
};
|
||
};
|
||
|
||
# Open ports in the firewall.
|
||
networking.firewall.allowedTCPPorts = [ 22 443 3000 ];
|
||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||
# Or disable the firewall altogether.
|
||
# networking.firewall.enable = false;
|
||
|
||
# This value determines the NixOS release from which the default
|
||
# settings for stateful data, like file locations and database versions
|
||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||
# this value at the release version of the first install of this system.
|
||
# Before changing this value read the documentation for this option
|
||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||
system.stateVersion = "24.05"; # Did you read the comment?
|
||
|
||
}
|