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