continuing things

This commit is contained in:
Schrottkatze 2023-04-26 23:25:04 +02:00
parent 6c2fea3b2f
commit bce60dc872
9 changed files with 156 additions and 45 deletions

View file

@ -2,9 +2,30 @@
{
networking.hostName = "katzen-cafe";
networking.firewall = {
allowedTCPPorts = [ 22 80 443 ];
};
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [ "console=tty" ];
boot.initrd.kernelModules = [ "virtio_gpu" ];
users.users.april = {
isNormalUser = true;
packages = with pkgs; [ podman ];
createHome = true;
};
services.openssh = {
enable = true;
permitRootLogin = "prohibit-password";
};
environment.systemPackages = with pkgs; [
neovim wget neofetch
];
fileSystems."/" = {
device = "/dev/sda1";
@ -17,6 +38,6 @@
};
swapDevices = [ {
device = "/dev/disk/by-uuid/9cb23bf3-128c-4847-8f72-f14f4aaa5026";
device = "/dev/sda2";
} ];
}

4
modules/conduit.nix Normal file
View file

@ -0,0 +1,4 @@
{ pkgs, inputs, ... }:
{
# TODO: matrix-conduit
}

View file

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
imports = [
./postgres.nix
./phtanumb-wiki.nix
];
}

View file

@ -0,0 +1,40 @@
{ pkgs, ... }:
{
containers."phtanumb-wiki" = {
autoStart = true;
localAddress = "127.0.0.1";
bindMounts = {
"/var/mediawiki" = {
hostPath = "/phtanum-b/wiki";
isReadOnly = false;
};
};
config = { config, pkgs, ... }: {
services.mediawiki = {
enable = true;
name = "phtanum-b";
virtualHost.listen = [
{
ip = "127.0.0.1";
port = 8080;
ssl = false;
}
];
virtualHost.hostName = "wiki.phtanum-b.katzen.cafe";
virtualHost.adminAddr = "admin@katzen.cafe";
passwordFile = "/var/mediawiki/passwordFile";
extraConfig = ''
# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;
'';
};
system.stateVersion = "22.11";
};
};
deployment.keys."passwordFile" = {
keyCommand = [ "cat" "/home/jade/keys/phtanumb-wiki/passwordFile" ];
destDir = "/var/mediawiki";
};
}

View file

@ -0,0 +1,32 @@
{ pkgs, ... }:
{
containers.postgres = {
autoStart = true;
localAddress = "127.0.0.1";
bindMounts = {
"/var/lib/postgresql" = {
hostPath = "/postgres";
isReadOnly = false;
};
};
config = { config, pkgs, ... }: {
services.postgresql = {
enable = true;
ensureUsers = [
{
name = "keycloak";
ensurePermissions = {
"DATABASE \"nextcloud\"" = "ALL PRIVILEGES";
};
}
];
ensureDatabases = [
"keycloak"
];
};
system.stateVersion = "22.11";
};
};
}

16
modules/keycloak.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs, ... }:
{
services.keycloak = {
enable = true;
settings = {
http-port = 8097;
proxy = "edge";
hostname = "auth.katzen.cafe";
};
database = {
createLocally = false;
};
};
}

View file

@ -12,6 +12,30 @@
group = "nginx";
keyType = "rsa4096";
};
"wiki.phtanum-b.katzen.cafe" = {
group = "nginx";
keyType = "rsa4096";
};
};
};
services.nginx = {
enable = true;
virtualHosts = {
"wiki.phtanum-b.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8080";
};
};
"auth.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8097";
};
};
};
};
}