Merge branch 'main' of ssh://git.0x76.dev:42/v/infrastructure

This commit is contained in:
Vivian 2023-04-29 19:48:06 +02:00
commit a7d5b82ed8
10 changed files with 47 additions and 78 deletions

View file

@ -1,40 +0,0 @@
# 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, ... }:
let
databases = [ "umami" "drone" ];
in
{
imports = [ ];
# 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. Its 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 = "21.11"; # Did you read the comment?
# Additional packages
environment.systemPackages = with pkgs; [ ];
networking.firewall.allowedTCPPorts = [ config.services.postgresql.port ];
services.postgresql =
{
enable = true;
package = pkgs.postgresql_14;
ensureDatabases = databases;
enableTCPIP = true;
# Allow all hosts on the server subnet, should probably lock this down more in the future
authentication = "host all all 10.42.42.0/24 trust";
ensureUsers = map
(name: {
inherit name;
ensurePermissions = { "DATABASE ${name}" = "ALL PRIVILEGES"; };
})
databases;
};
}

View file

@ -110,10 +110,7 @@
ip = "10.42.42.25";
mac = "1E:ED:97:2C:C3:9D";
};
"database" = {
ip = "10.42.42.26";
mac = "CE:6E:96:87:18:1B";
};
# 10.42.42.26
"bookwyrm" = {
ip = "10.42.42.27";
mac = "9E:8A:6C:39:27:DE";
@ -123,11 +120,7 @@
ip = "10.42.42.28";
mac = "9E:86:D3:46:EE:AE";
};
"slimmelezer" = {
ip = "10.42.42.29";
mac = "b4:8a:0a:ee:b0:5e";
nix = false;
};
# 10.42.42.29
"vault-1" = {
ip = "10.42.42.30";
mac = "26:69:0E:7C:B3:79";

View file

@ -25,12 +25,18 @@ in {
quoteEnvironmentValues = false; # Needed for docker
};
# For some reason networking is broken in podman
virtualisation.podman = {
enable = true;
enable = false;
dockerSocket.enable = true;
dockerCompat = true;
};
virtualisation.docker = {
enable = true;
autoPrune.enable = true;
};
services.woodpecker-server = {
enable = true;
environment = {
@ -49,12 +55,12 @@ in {
docker = {
enable = true;
environment = {
DOCKER_HOST = "unix:///run/podman/podman.sock";
# DOCKER_HOST = "unix:///run/podman/podman.sock";
WOODPECKER_BACKEND = "docker";
WOODPECKER_SERVER = "localhost:9000";
};
environmentFile = [ "${vs.woodpecker}/environment" ];
extraGroups = [ "podman" ];
extraGroups = [ "docker" ];
};
};
}