2015-12-14 17:56:50 +01:00
|
|
|
{ lib, config, pkgs, ... }:
|
2016-01-18 12:54:03 +01:00
|
|
|
{
|
2015-12-14 14:33:06 +01:00
|
|
|
krebs.build.host = config.krebs.hosts.vbob;
|
2016-04-17 02:03:15 +02:00
|
|
|
makefu.awesome.modkey = "Mod1";
|
2015-12-14 14:33:06 +01:00
|
|
|
imports =
|
2017-12-28 16:04:47 +01:00
|
|
|
[
|
2017-07-15 19:01:02 +02:00
|
|
|
<stockholm/makefu>
|
2017-12-28 16:04:47 +01:00
|
|
|
{
|
|
|
|
imports = [<stockholm/makefu/2configs/fs/single-partition-ext4.nix> ];
|
2018-01-06 20:53:33 +01:00
|
|
|
boot.loader.grub.device = "/dev/sda";
|
2017-12-28 16:04:47 +01:00
|
|
|
}
|
2018-02-14 09:41:59 +01:00
|
|
|
<stockholm/makefu/2configs/hw/vbox-guest.nix>
|
|
|
|
# <nixpkgs/nixos/modules/virtualisation/qemu-vm.nix>
|
2017-12-28 16:04:47 +01:00
|
|
|
|
2017-07-15 23:19:06 +02:00
|
|
|
# base gui
|
2017-12-28 16:04:47 +01:00
|
|
|
# <stockholm/makefu/2configs/main-laptop.nix>
|
|
|
|
# <stockholm/makefu/2configs/tools/core-gui.nix>
|
|
|
|
|
|
|
|
<stockholm/makefu/2configs/zsh-user.nix>
|
2017-07-15 23:19:06 +02:00
|
|
|
|
|
|
|
# security
|
2017-07-15 19:01:02 +02:00
|
|
|
<stockholm/makefu/2configs/sshd-totp.nix>
|
2015-12-14 14:33:06 +01:00
|
|
|
|
2017-06-29 00:14:54 +02:00
|
|
|
# Tools
|
2017-07-15 19:01:02 +02:00
|
|
|
<stockholm/makefu/2configs/tools/core.nix>
|
|
|
|
<stockholm/makefu/2configs/tools/dev.nix>
|
2017-12-28 16:04:47 +01:00
|
|
|
# <stockholm/makefu/2configs/tools/extra-gui.nix>
|
|
|
|
# <stockholm/makefu/2configs/tools/sec.nix>
|
2017-06-29 00:14:54 +02:00
|
|
|
|
2015-12-14 14:33:06 +01:00
|
|
|
# environment
|
2017-07-15 19:01:02 +02:00
|
|
|
<stockholm/makefu/2configs/tinc/retiolum.nix>
|
2018-01-06 20:53:33 +01:00
|
|
|
(let
|
|
|
|
gum-ip = config.krebs.hosts.gum.nets.internet.ip4.addr;
|
2018-01-06 23:44:03 +01:00
|
|
|
gateway = "10.0.2.2";
|
2018-01-06 20:53:33 +01:00
|
|
|
in {
|
2018-01-06 23:44:03 +01:00
|
|
|
# make sure the route to gum gets added after the network is online
|
|
|
|
systemd.services.wireguard-wg0.after = [ "network-online.target" ];
|
2018-01-06 20:53:33 +01:00
|
|
|
networking.wireguard.interfaces.wg0 = {
|
|
|
|
ips = [ "10.244.0.3/24" ];
|
|
|
|
privateKeyFile = (toString <secrets>) + "/wireguard.key";
|
|
|
|
# explicit route via eth0 to gum
|
2018-01-06 23:44:03 +01:00
|
|
|
preSetup = ["${pkgs.iproute}/bin/ip route add ${gum-ip} via ${gateway}"];
|
2018-01-06 20:53:33 +01:00
|
|
|
peers = [
|
2018-01-06 23:44:03 +01:00
|
|
|
{ # gum
|
2018-01-06 20:53:33 +01:00
|
|
|
endpoint = "${gum-ip}:51820";
|
2018-01-06 23:44:03 +01:00
|
|
|
allowedIPs = [ "0.0.0.0/0" "10.244.0.0/24" ];
|
2018-01-06 20:53:33 +01:00
|
|
|
publicKey = "yAKvxTvcEVdn+MeKsmptZkR3XSEue+wSyLxwcjBYxxo=";
|
2018-01-06 23:44:03 +01:00
|
|
|
persistentKeepalive = 25;
|
2018-01-06 20:53:33 +01:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
})
|
2015-12-14 17:56:50 +01:00
|
|
|
|
2015-12-14 14:33:06 +01:00
|
|
|
];
|
2016-11-14 15:59:54 +01:00
|
|
|
networking.extraHosts = import (toString <secrets/extra-hosts.nix>);
|
2015-12-16 14:30:21 +01:00
|
|
|
|
2015-12-14 17:56:50 +01:00
|
|
|
# allow vbob to deploy self
|
2018-02-14 09:41:59 +01:00
|
|
|
users.extraUsers.root.openssh.authorizedKeys.keys = [ config.krebs.users.makefu-vbob.pubkey ];
|
2016-07-18 18:57:36 +02:00
|
|
|
|
|
|
|
environment.shellAliases = {
|
|
|
|
forti = "cat ~/vpn/pw.txt | xclip; sudo forticlientsslvpn";
|
|
|
|
};
|
2017-12-28 16:04:47 +01:00
|
|
|
|
|
|
|
system.activationScripts.prepare-fortclientvpnssl = ''
|
|
|
|
# TODO: for forticlientsslpn
|
|
|
|
mkdir -p /usr/{s,}bin
|
|
|
|
ln -fs ${pkgs.ppp}/bin/pppd /usr/sbin/pppd
|
|
|
|
ln -fs ${pkgs.coreutils}/bin/tail /usr/bin/tail
|
|
|
|
'';
|
2015-12-14 14:33:06 +01:00
|
|
|
environment.systemPackages = with pkgs;[
|
2016-07-18 18:57:36 +02:00
|
|
|
fortclientsslvpn ppp xclip
|
2015-12-14 14:33:06 +01:00
|
|
|
get
|
2016-01-18 12:54:03 +01:00
|
|
|
logstash
|
2016-11-14 15:59:54 +01:00
|
|
|
#devpi-web
|
|
|
|
#devpi-client
|
|
|
|
ansible
|
2015-12-14 17:56:50 +01:00
|
|
|
];
|
2016-05-02 16:02:15 +02:00
|
|
|
|
2015-12-14 14:33:06 +01:00
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
25
|
|
|
|
80
|
2015-12-16 17:53:35 +01:00
|
|
|
8010
|
2015-12-14 14:33:06 +01:00
|
|
|
];
|
2018-02-14 09:41:59 +01:00
|
|
|
# required for qemu
|
2018-01-06 20:53:33 +01:00
|
|
|
systemd.services."serial-getty@ttyS0".enable = true;
|
2015-12-14 14:33:06 +01:00
|
|
|
}
|