forked from katzen-cafe/katzen-cafe
continuing things
This commit is contained in:
parent
6c2fea3b2f
commit
bce60dc872
9 changed files with 156 additions and 45 deletions
|
@ -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
4
modules/conduit.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ pkgs, inputs, ... }:
|
||||
{
|
||||
# TODO: matrix-conduit
|
||||
}
|
7
modules/containers/default.nix
Normal file
7
modules/containers/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./postgres.nix
|
||||
./phtanumb-wiki.nix
|
||||
];
|
||||
}
|
40
modules/containers/phtanumb-wiki.nix
Normal file
40
modules/containers/phtanumb-wiki.nix
Normal 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";
|
||||
};
|
||||
}
|
32
modules/containers/postgres.nix
Normal file
32
modules/containers/postgres.nix
Normal 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
16
modules/keycloak.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
services.keycloak = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
http-port = 8097;
|
||||
proxy = "edge";
|
||||
hostname = "auth.katzen.cafe";
|
||||
};
|
||||
|
||||
database = {
|
||||
createLocally = false;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue