2022-04-30 20:43:12 +00:00
|
|
|
{ config, lib, pkgs, profiles, modules, evalConfig, sources, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
uffd = pkgs.uffd;
|
|
|
|
in {
|
|
|
|
containers.uffd = {
|
|
|
|
privateNetwork = true;
|
|
|
|
hostAddress = "192.168.100.1";
|
|
|
|
localAddress = "192.168.100.9";
|
|
|
|
autoStart = true;
|
|
|
|
bindMounts = {
|
|
|
|
"/persist" = {
|
|
|
|
hostPath = "/persist/containers/uffd";
|
|
|
|
isReadOnly = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
path = (evalConfig {hosts = {}; groups = {};} ({ config, lib, pkgs, profiles, modules, sources, ... }: {
|
|
|
|
boot.isContainer = true;
|
|
|
|
networking.useDHCP = false;
|
|
|
|
users.users.root.hashedPassword = "";
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
((import sources.nix-hexchen) {}).profiles.nopersist
|
|
|
|
];
|
|
|
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
networking.firewall.enable = false;
|
|
|
|
networking.defaultGateway = {
|
|
|
|
address = "192.168.100.1";
|
|
|
|
interface = "eth0";
|
|
|
|
};
|
|
|
|
services.coredns = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
|
|
|
.:53 {
|
|
|
|
forward . 1.1.1.1
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
services.uwsgi = {
|
|
|
|
enable = true;
|
|
|
|
plugins = [ "python3" ];
|
|
|
|
instance = {
|
|
|
|
type = "normal";
|
|
|
|
pythonPackages = self: with self; [ uffd ];
|
|
|
|
module = "uffd:create_app()";
|
|
|
|
# socket = "${config.services.uwsgi.runDir}/uwsgi.sock";
|
|
|
|
http = ":8080";
|
|
|
|
env = [
|
|
|
|
"CONFIG_PATH=/persist/uffd/uffd.conf"
|
|
|
|
];
|
|
|
|
hook-pre-app = "exec:FLASK_APP=${uffd}/lib/python3.9/site-packages/uffd flask db upgrade";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})).config.system.build.toplevel;
|
|
|
|
};
|
|
|
|
services.nginx.virtualHosts."login.infra4future.de" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations = {
|
|
|
|
"/".proxyPass = "http://${config.containers.uffd.localAddress}:8080";
|
|
|
|
"/static".root = "${uffd}/lib/python3.9/site-packages/uffd";
|
2022-05-02 15:53:27 +00:00
|
|
|
"/static/hacc.png".return = "302 https://infra4future.de/assets/img/logo_vernetzung.png";
|
|
|
|
"/static/infra4future.svg".return = "302 https://infra4future.de/assets/img/infra4future.svg";
|
2022-05-02 16:28:37 +00:00
|
|
|
"/static/hedgedoc.svg".return = "302 https://infra4future.de/assets/img/icons/hedgedoc.svg";
|
|
|
|
"/static/mattermost.svg".return = "302 https://infra4future.de/assets/img/icons/mattermost.svg";
|
|
|
|
"/static/nextcloud.svg".return = "302 https://infra4future.de/assets/img/icons/nextcloud.svg";
|
|
|
|
"/static/hot_shit.svg".return = "302 https://infra4future.de/assets/img/icons/hot_shit.svg";
|
2022-04-30 20:43:12 +00:00
|
|
|
};
|
|
|
|
};
|
2022-07-09 08:40:36 +00:00
|
|
|
|
|
|
|
systemd.services.auamost = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
description = "mattermost aua gruppensync";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
after = [ "network.target" ];
|
|
|
|
serviceConfig.Type = "simple";
|
2022-07-09 17:11:30 +00:00
|
|
|
path = [ pkgs.curl pkgs.jq ];
|
2022-07-09 08:40:36 +00:00
|
|
|
script = "${pkgs.fish}/bin/fish /persist/magic/mattermost-groupsync.fish";
|
2022-07-09 17:11:30 +00:00
|
|
|
startAt = "*:0/15";
|
2022-07-09 08:40:36 +00:00
|
|
|
};
|
2022-04-30 20:43:12 +00:00
|
|
|
}
|