stuebinm
3be22b7249
This is an initial test config for mattermost on NixOS; the intention is to perhaps deploy this as soon as it looks reasonable, then have it running as a "beta instance" in parallel with the current instance on libocedrus for a while to see if any issues come up before we can make a permament switch here. The mattermost module has a somewhat weird approach to database configuration (per default, it generates an entire postgres config, and if told not to do that, it generates a /disabled/ postgrs config ...), which I have for the most part worked around. Mattermost provides extensive configuration options, which are usually changed using its web UI. I have instead set the more important ones using Nix, and made the config immutable --- however, the config of our current instance is rather long and full of default values; it may well be that I missed some important settings. Open questions which we may want to answer before deploying this: - is there a reason why we use mysql for our current instance? At least during my tests, mattermost appears to work just fine with postgres - to access the noreply@infra4future.de mail address, mattermost needs a password, which --- as it looks right now --- must be set in the nix store. Can we work around that or should we fork / override the module? - plugins are apparently broken right now - locales are broken as well, for whatever reason — the german locale is definitively present, but setting it as the default will break and then reverted by mattermost on startup - for now, I have set `mutableConfig` to `false`, i.e. any changes done in the mattermost web UI will be overwritten on next startup. This is great for reproducability, but less so for ease of use (and perhaps for secrets as well) --- do we want to keep it this way? - as it is right now, using this instead of our current instance would represent a version DOWNGRADE (from 5.30.6. to 5.25.3); this may break the database schema. We may have to package a more recent version of mattermost and use that instead. Things I was unable to test locally (in a nixos container): - authentication using "gitlab" / keycloak - mail notifications (including coredns forwarding) - more advanced stuff like notifications, anything to do with "true" multi-user interaction
129 lines
4 KiB
Nix
129 lines
4 KiB
Nix
{ config, lib, pkgs, ... }:
|
||
|
||
{
|
||
imports = [
|
||
../../common
|
||
./encboot.nix
|
||
./hardware.nix
|
||
./services/murmur.nix
|
||
./services/mail.nix
|
||
./services/codimd.nix
|
||
../../common
|
||
# ./wireguard.nix
|
||
./services/nginx.nix
|
||
# ./k8s.nix
|
||
./services/docker.nix
|
||
./services/gitlab-runner.nix
|
||
./services/lantifa.nix
|
||
./services/hasenloch.nix
|
||
./services/syncthing.nix
|
||
./services/monitoring.nix
|
||
./services/workadventure.nix
|
||
./services/mattermost.nix
|
||
];
|
||
boot.loader.grub.enable = true;
|
||
boot.loader.grub.version = 2;
|
||
boot.loader.grub.device = "/dev/sda";
|
||
boot.supportedFilesystems = [ "zfs" ];
|
||
|
||
# networking
|
||
networking.hostName = "hainich";
|
||
networking.hostId = "8a58cb2f";
|
||
networking.useDHCP = true;
|
||
networking.interfaces.enp6s0.ipv4.addresses = [
|
||
{
|
||
address = "46.4.63.148";
|
||
prefixLength = 27;
|
||
}
|
||
|
||
{
|
||
address = "46.4.63.158";
|
||
prefixLength = 27;
|
||
}
|
||
];
|
||
networking.interfaces.enp6s0.ipv6.addresses = [ {
|
||
address = "2a01:4f8:140:84c9::1";
|
||
prefixLength = 64;
|
||
} ];
|
||
networking.defaultGateway = "46.4.63.129";
|
||
networking.nameservers = [
|
||
"1.1.1.1" "1.0.0.1"
|
||
"2606:4700:4700::1111" "2606:4700:4700::1001"
|
||
];
|
||
networking.defaultGateway6 = {
|
||
address = "fe80::1";
|
||
interface = "enp6s0";
|
||
};
|
||
|
||
hacc.nftables.nat.enable = true;
|
||
networking.nat.internalInterfaces = ["ve-+"];
|
||
networking.nat.internalIPs = [ "192.168.100.0/24" "172.17.0.0/16" ];
|
||
networking.nat.externalInterface = "enp6s0";
|
||
|
||
|
||
networking.firewall.allowedTCPPorts = [ 22 80 443 ];
|
||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||
# networking.firewall.enable = false;
|
||
|
||
# misc
|
||
time.timeZone = "UTC";
|
||
|
||
environment.systemPackages = with pkgs; [
|
||
wget vim git
|
||
];
|
||
|
||
services.openssh.enable = true;
|
||
services.openssh.ports = [ 22 62954 ];
|
||
|
||
users.users.root = {
|
||
openssh.authorizedKeys.keys = [
|
||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL6JWi0MBDz0Zy4zjauQv28xYmHyapb8D4zeesq91LLE schweby@txsbcct"
|
||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCvmrk3i04tXfrSlZtHFbG3o6lQgh3ODMWmGDING4TJ4ctidexmMNY15IjVjzXZgQSET1uKLDLITiaPsii8vaWERZfjm3jjub845mpKkKv48nYdM0eCbv7n604CA3lwoB5ebRgULg4oGTi60rQ4trFf3iTkJfmiLsieFBZz7l+DfgeDEjDNSJcrkOggGBrjE5vBXoDimdkNh8kBNwgMDj1kPR/FHDqybSd5hohCJ5FzQg9vzl/x/H1rzJJKYPO4svSgHkYNkeoL84IZNeHom+UEHX0rw2qAIEN6AiHvNUJR38relvQYxbVdDSlaGN3g26H2ehsmolf+U0uQlRAXTHo0NbXNVYOfijFKL/jWxNfH0aRycf09Lu60oY54gkqS/J0GoQe/OGNq1Zy72DI+zAwEzyCGfSDbAgVF7Y3mU2HqcqGqNzu7Ade5oCbLmkT7yzDM3x6IsmT1tO8dYiT8Qv+zFAECkRpw3yDkJkPOxNKg10oM318whMTtM3yqntE90hk= schweby@taxusbaccata"
|
||
];
|
||
initialHashedPassword = "$6$F316njEF2$GMF4OmPSF6QgZ3P/DblQ/UFMgoo98bztbdw7X0ygvBGC1UMMIc13Vtxjd/ZGRYW/pEHACZZ7sbRZ48t6xhvO7/";
|
||
# shell = pkgs.fish;
|
||
};
|
||
|
||
# storage stuffs!
|
||
services.zfs = {
|
||
autoSnapshot = {
|
||
enable = true;
|
||
};
|
||
autoScrub = {
|
||
enable = true;
|
||
};
|
||
};
|
||
|
||
boot.kernelPackages = pkgs.linuxPackages;
|
||
|
||
# services.restic.backups.tardis = {
|
||
# passwordFile = "/etc/restic/system";
|
||
# s3CredentialsFile = "/etc/restic/system.s3creds";
|
||
# paths = [
|
||
# "/data"
|
||
# "/home"
|
||
# "/run/florinori"
|
||
# "/var/lib/containers/codimd/var/lib/codimd"
|
||
# "/var/lib/containers/codimd/var/backup/postgresql"
|
||
# "/var/lib/containers/lantifa/var/lib/mediawiki"
|
||
# "/var/lib/containers/lantifa/var/backup/mysql"
|
||
# "/var/lib/murmur"
|
||
# "/var/lib/syncthing"
|
||
# ];
|
||
# pruneOpts = [
|
||
# "--keep-daily 7"
|
||
# "--keep-weekly 5"
|
||
# "--keep-monthly 12"
|
||
# ];
|
||
# repository = "b2:tardis-hainich:system";
|
||
# };
|
||
|
||
|
||
# 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 = "20.03"; # Did you read the comment?
|
||
}
|