2015-10-28 14:06:41 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2016-10-20 18:54:38 +00:00
|
|
|
with import <stockholm/lib>;
|
2015-10-28 14:06:41 +00:00
|
|
|
let
|
2016-04-08 01:53:34 +00:00
|
|
|
external-ip = config.krebs.build.host.nets.internet.ip4.addr;
|
2018-06-17 20:54:59 +00:00
|
|
|
ext-if = config.makefu.server.primary-itf;
|
2015-10-28 14:06:41 +00:00
|
|
|
in {
|
|
|
|
imports = [
|
2017-07-15 17:01:02 +00:00
|
|
|
<stockholm/makefu>
|
2018-06-17 20:54:59 +00:00
|
|
|
./hardware-config.nix
|
2018-11-05 15:22:39 +00:00
|
|
|
{
|
|
|
|
users.users.lass = {
|
|
|
|
uid = 9002;
|
|
|
|
isNormalUser = true;
|
|
|
|
createHome = true;
|
|
|
|
useDefaultShell = true;
|
|
|
|
openssh.authorizedKeys.keys = with config.krebs.users; [
|
|
|
|
lass.pubkey
|
|
|
|
makefu.pubkey
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|
2017-07-15 17:01:02 +00:00
|
|
|
<stockholm/makefu/2configs/headless.nix>
|
|
|
|
# <stockholm/makefu/2configs/smart-monitor.nix>
|
2017-11-02 13:27:55 +00:00
|
|
|
|
2017-06-30 21:49:05 +00:00
|
|
|
# Security
|
2017-07-15 17:01:02 +00:00
|
|
|
<stockholm/makefu/2configs/sshd-totp.nix>
|
2017-06-30 21:49:05 +00:00
|
|
|
|
2017-05-02 12:03:25 +00:00
|
|
|
# Tools
|
2017-07-15 17:01:02 +00:00
|
|
|
<stockholm/makefu/2configs/tools/core.nix>
|
|
|
|
<stockholm/makefu/2configs/tools/dev.nix>
|
|
|
|
<stockholm/makefu/2configs/tools/sec.nix>
|
2017-07-21 08:48:29 +00:00
|
|
|
<stockholm/makefu/2configs/zsh-user.nix>
|
2018-11-05 15:22:39 +00:00
|
|
|
<stockholm/makefu/2configs/mosh.nix>
|
|
|
|
# <stockholm/makefu/2configs/gui/xpra.nix>
|
|
|
|
|
|
|
|
# networking
|
|
|
|
<stockholm/makefu/2configs/vpn/openvpn-server.nix>
|
|
|
|
# <stockholm/makefu/2configs/vpn/vpnws/server.nix>
|
|
|
|
#<stockholm/makefu/2configs/dnscrypt/server.nix>
|
|
|
|
<stockholm/makefu/2configs/iodined.nix>
|
|
|
|
# <stockholm/makefu/2configs/backup.nix>
|
|
|
|
<stockholm/makefu/2configs/tinc/retiolum.nix>
|
|
|
|
|
|
|
|
# ci
|
|
|
|
# <stockholm/makefu/2configs/exim-retiolum.nix>
|
|
|
|
<stockholm/makefu/2configs/git/cgit-retiolum.nix>
|
|
|
|
<stockholm/makefu/2configs/shack/gitlab-runner>
|
|
|
|
<stockholm/makefu/2configs/remote-build/slave.nix>
|
|
|
|
<stockholm/makefu/2configs/taskd.nix>
|
2017-05-02 12:03:25 +00:00
|
|
|
|
2017-02-04 13:35:29 +00:00
|
|
|
# services
|
2018-11-05 15:22:39 +00:00
|
|
|
<stockholm/makefu/2configs/sabnzbd.nix>
|
|
|
|
<stockholm/makefu/2configs/mail/mail.euer.nix>
|
|
|
|
|
|
|
|
# sharing
|
2017-07-15 17:01:02 +00:00
|
|
|
<stockholm/makefu/2configs/share/gum.nix>
|
2017-09-29 19:37:24 +00:00
|
|
|
<stockholm/makefu/2configs/torrent.nix>
|
2018-11-05 15:22:39 +00:00
|
|
|
#<stockholm/makefu/2configs/retroshare.nix>
|
|
|
|
## <stockholm/makefu/2configs/ipfs.nix>
|
|
|
|
#<stockholm/makefu/2configs/syncthing.nix>
|
|
|
|
{ # ncdc
|
|
|
|
environment.systemPackages = [ pkgs.ncdc ];
|
|
|
|
networking.firewall = {
|
|
|
|
allowedUDPPorts = [ 51411 ];
|
|
|
|
allowedTCPPorts = [ 51411 ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
# <stockholm/makefu/2configs/opentracker.nix>
|
2017-12-28 15:03:38 +00:00
|
|
|
|
2018-11-05 15:22:39 +00:00
|
|
|
## network
|
2017-08-16 10:09:18 +00:00
|
|
|
<stockholm/makefu/2configs/vpn/openvpn-server.nix>
|
2018-03-28 09:06:40 +00:00
|
|
|
# <stockholm/makefu/2configs/vpn/vpnws/server.nix>
|
2017-09-04 08:11:32 +00:00
|
|
|
<stockholm/makefu/2configs/dnscrypt/server.nix>
|
2018-11-05 15:22:39 +00:00
|
|
|
<stockholm/makefu/2configs/binary-cache/server.nix>
|
|
|
|
<stockholm/makefu/2configs/backup/server.nix>
|
2017-12-28 15:03:38 +00:00
|
|
|
<stockholm/makefu/2configs/iodined.nix>
|
2018-11-05 15:22:39 +00:00
|
|
|
<stockholm/makefu/2configs/bitlbee.nix>
|
|
|
|
<stockholm/makefu/2configs/wireguard/server.nix>
|
2017-12-28 15:03:38 +00:00
|
|
|
|
2018-11-05 15:22:39 +00:00
|
|
|
# Removed until move: no extra mails
|
|
|
|
<stockholm/makefu/2configs/urlwatch>
|
|
|
|
# Removed until move: avoid letsencrypt ban
|
|
|
|
### Web
|
2018-10-21 21:33:33 +00:00
|
|
|
#<stockholm/makefu/2configs/nginx/share-download.nix>
|
|
|
|
#<stockholm/makefu/2configs/nginx/euer.test.nix>
|
2018-11-05 15:22:39 +00:00
|
|
|
<stockholm/makefu/2configs/nginx/euer.mon.nix>
|
|
|
|
<stockholm/makefu/2configs/nginx/euer.wiki.nix>
|
|
|
|
<stockholm/makefu/2configs/nginx/euer.blog.nix>
|
2018-10-21 21:33:33 +00:00
|
|
|
## <stockholm/makefu/2configs/nginx/gum.krebsco.de.nix>
|
|
|
|
#<stockholm/makefu/2configs/nginx/public_html.nix>
|
|
|
|
#<stockholm/makefu/2configs/nginx/update.connector.one.nix>
|
2018-11-05 15:22:39 +00:00
|
|
|
<stockholm/makefu/2configs/nginx/misa-felix-hochzeit.ml.nix>
|
|
|
|
<stockholm/makefu/2configs/nginx/gold.krebsco.de.nix>
|
|
|
|
<stockholm/makefu/2configs/nginx/iso.euer.nix>
|
|
|
|
<stockholm/makefu/2configs/shack/events-publisher>
|
2017-02-04 13:35:29 +00:00
|
|
|
|
2018-11-05 15:22:39 +00:00
|
|
|
<stockholm/makefu/2configs/deployment/photostore.krebsco.de.nix>
|
|
|
|
<stockholm/makefu/2configs/deployment/graphs.nix>
|
|
|
|
<stockholm/makefu/2configs/deployment/owncloud.nix>
|
|
|
|
<stockholm/makefu/2configs/deployment/boot-euer.nix>
|
|
|
|
<stockholm/makefu/2configs/deployment/bgt/hidden_service.nix>
|
2018-06-17 20:54:59 +00:00
|
|
|
|
2017-07-15 17:01:02 +00:00
|
|
|
<stockholm/makefu/2configs/stats/client.nix>
|
|
|
|
# <stockholm/makefu/2configs/logging/client.nix>
|
2015-12-29 20:20:36 +00:00
|
|
|
|
2018-11-05 15:22:39 +00:00
|
|
|
# sharing
|
|
|
|
<stockholm/makefu/2configs/dcpp/airdcpp.nix>
|
|
|
|
<stockholm/makefu/2configs/dcpp/hub.nix>
|
|
|
|
|
|
|
|
## Temporary:
|
2017-11-14 09:17:16 +00:00
|
|
|
# <stockholm/makefu/2configs/temp/rst-issue.nix>
|
2017-12-08 12:38:57 +00:00
|
|
|
<stockholm/makefu/2configs/virtualisation/docker.nix>
|
2018-11-05 15:22:39 +00:00
|
|
|
<stockholm/makefu/2configs/virtualisation/libvirt.nix>
|
2017-12-08 12:38:57 +00:00
|
|
|
|
2018-11-05 15:22:39 +00:00
|
|
|
# krebs infrastructure services
|
|
|
|
<stockholm/makefu/2configs/stats/server.nix>
|
2015-10-28 14:06:41 +00:00
|
|
|
];
|
2017-02-04 13:35:29 +00:00
|
|
|
makefu.dl-dir = "/var/download";
|
2015-11-27 22:10:44 +00:00
|
|
|
|
2017-10-08 21:14:14 +00:00
|
|
|
services.openssh.hostKeys = [
|
2017-12-08 12:38:57 +00:00
|
|
|
{ bits = 4096; path = (toString <secrets/ssh_host_rsa_key>); type = "rsa"; }
|
|
|
|
{ path = (toString <secrets/ssh_host_ed25519_key>); type = "ed25519"; } ];
|
2015-11-27 22:10:44 +00:00
|
|
|
###### stable
|
2016-12-24 22:40:38 +00:00
|
|
|
services.nginx.virtualHosts.cgit.serverAliases = [ "cgit.euer.krebsco.de" ];
|
2015-11-10 17:53:31 +00:00
|
|
|
krebs.build.host = config.krebs.hosts.gum;
|
2017-02-04 13:35:29 +00:00
|
|
|
|
2016-07-20 15:18:57 +00:00
|
|
|
krebs.tinc.retiolum = {
|
2016-03-11 01:10:34 +00:00
|
|
|
extraConfig = ''
|
|
|
|
ListenAddress = ${external-ip} 53
|
|
|
|
ListenAddress = ${external-ip} 655
|
|
|
|
ListenAddress = ${external-ip} 21031
|
|
|
|
'';
|
|
|
|
connectTo = [
|
2018-11-05 15:22:39 +00:00
|
|
|
"prism" "ni" "enklave" "dishfire" "echelon" "hotdog"
|
2016-03-11 01:10:34 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2015-11-27 22:10:44 +00:00
|
|
|
|
2016-03-16 07:42:19 +00:00
|
|
|
# access
|
|
|
|
users.users = {
|
|
|
|
root.openssh.authorizedKeys.keys = [ config.krebs.users.makefu-omo.pubkey ];
|
2017-02-08 17:37:15 +00:00
|
|
|
makefu.openssh.authorizedKeys.keys = [ config.krebs.users.makefu-vbob.pubkey config.krebs.users.makefu-bob.pubkey ];
|
2016-03-16 07:42:19 +00:00
|
|
|
};
|
|
|
|
|
2018-11-05 15:22:39 +00:00
|
|
|
# Chat
|
|
|
|
environment.systemPackages = with pkgs;[
|
|
|
|
weechat
|
|
|
|
bepasty-client-cli
|
|
|
|
tmux
|
|
|
|
];
|
|
|
|
|
|
|
|
# Hardware
|
|
|
|
|
2015-11-10 17:53:31 +00:00
|
|
|
# Network
|
2015-10-28 14:06:41 +00:00
|
|
|
networking = {
|
2015-11-13 11:24:29 +00:00
|
|
|
firewall = {
|
2018-11-05 15:22:39 +00:00
|
|
|
allowPing = true;
|
|
|
|
logRefusedConnections = false;
|
|
|
|
allowedTCPPorts = [
|
2015-11-13 11:24:29 +00:00
|
|
|
# smtp
|
|
|
|
25
|
|
|
|
# http
|
|
|
|
80 443
|
2018-04-04 12:39:03 +00:00
|
|
|
# httptunnel
|
|
|
|
8080 8443
|
2015-11-13 11:24:29 +00:00
|
|
|
# tinc
|
|
|
|
655
|
2015-12-14 13:18:34 +00:00
|
|
|
# tinc-shack
|
|
|
|
21032
|
|
|
|
# tinc-retiolum
|
|
|
|
21031
|
2016-04-10 21:24:15 +00:00
|
|
|
# taskserver
|
|
|
|
53589
|
2017-05-24 08:53:50 +00:00
|
|
|
# temp vnc
|
|
|
|
18001
|
2017-09-29 19:37:24 +00:00
|
|
|
# temp reverseshell
|
|
|
|
31337
|
2015-11-13 11:24:29 +00:00
|
|
|
];
|
|
|
|
allowedUDPPorts = [
|
|
|
|
# tinc
|
|
|
|
655 53
|
2015-12-14 13:18:34 +00:00
|
|
|
# tinc-retiolum
|
|
|
|
21031
|
|
|
|
# tinc-shack
|
|
|
|
21032
|
2015-11-13 11:24:29 +00:00
|
|
|
];
|
2015-11-10 17:53:31 +00:00
|
|
|
};
|
2018-11-05 15:22:39 +00:00
|
|
|
nameservers = [ "8.8.8.8" ];
|
|
|
|
};
|
2018-06-17 20:54:59 +00:00
|
|
|
users.users.makefu.extraGroups = [ "download" "nginx" ];
|
2018-06-24 21:45:48 +00:00
|
|
|
boot.tmpOnTmpfs = true;
|
2018-11-05 15:22:39 +00:00
|
|
|
state = [ "/home/makefu/.weechat" ];
|
2015-10-28 14:06:41 +00:00
|
|
|
}
|