stockholm/makefu/1systems/vbob/config.nix

121 lines
3.2 KiB
Nix
Raw Normal View History

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
[
<stockholm/makefu>
2017-12-28 15:04:47 +00:00
{
imports = [<stockholm/makefu/2configs/fs/single-partition-ext4.nix> ];
boot.loader.grub.device = "/dev/sda";
2017-12-28 15:04:47 +00:00
}
{ ## Virtualbox guest is broken on newer kernel
# virtualisation.virtualbox.guest.enable = true;
}
2017-12-28 15:04:47 +00:00
# {
# imports = [
# <nixpkgs/nixos/modules/virtualisation/virtualbox-image.nix>
# ];
# virtualbox.baseImageSize = 35 * 1024;
# fileSystems."/media/share" = {
# fsType = "vboxsf";
# device = "share";
# options = [ "rw" "uid=9001" "gid=9001" ];
# };
# }
# {
# imports = [
# <nixpkgs/nixos/modules/virtualisation/qemu-vm.nix>
# ];
# fileSystems."/nix" = {
# device ="/dev/disk/by-label/nixstore";
# fsType = "ext4";
# };
# }
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
<stockholm/makefu/2configs/sshd-totp.nix>
2015-12-14 13:33:06 +00:00
# Tools
<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>
2015-12-14 13:33:06 +00:00
# environment
<stockholm/makefu/2configs/tinc/retiolum.nix>
(let
gum-ip = config.krebs.hosts.gum.nets.internet.ip4.addr;
gateway = "10.0.2.2";
in {
# make sure the route to gum gets added after the network is online
systemd.services.wireguard-wg0.after = [ "network-online.target" ];
networking.wireguard.interfaces.wg0 = {
ips = [ "10.244.0.3/24" ];
privateKeyFile = (toString <secrets>) + "/wireguard.key";
# explicit route via eth0 to gum
preSetup = ["${pkgs.iproute}/bin/ip route add ${gum-ip} via ${gateway}"];
peers = [
{ # gum
endpoint = "${gum-ip}:51820";
allowedIPs = [ "0.0.0.0/0" "10.244.0.0/24" ];
publicKey = "yAKvxTvcEVdn+MeKsmptZkR3XSEue+wSyLxwcjBYxxo=";
persistentKeepalive = 25;
}
];
};
})
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>);
nixpkgs.config.allowUnfree = true;
2015-12-14 16:56:50 +00:00
# allow vbob to deploy self
users.extraUsers = {
root = {
openssh.authorizedKeys.keys = [ config.krebs.users.makefu-vbob.pubkey ];
};
};
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
'';
2015-12-14 13:33:06 +00:00
environment.systemPackages = with pkgs;[
fortclientsslvpn ppp xclip
2015-12-14 13:33:06 +00:00
get
2016-01-18 11:54:03 +00:00
logstash
2016-10-22 12:21:22 +00:00
# docker
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
# virtualisation.docker.enable = true;
2015-12-14 13:33:06 +00:00
networking.firewall.allowedTCPPorts = [
25
80
8010
2015-12-14 13:33:06 +00:00
];
systemd.services."serial-getty@ttyS0".enable = true;
2015-12-14 13:33:06 +00:00
}