shared wolf: static ip, fix todo

This commit is contained in:
makefu 2015-11-17 22:15:07 +01:00
parent a4ab19181b
commit 5aed0a395b
5 changed files with 74 additions and 6 deletions

View File

@ -86,6 +86,7 @@ let
krebs.dns.providers = {
de.krebsco = "zones";
gg23 = "hosts";
shack = "hosts";
internet = "hosts";
retiolum = "hosts";
};

View File

@ -33,12 +33,17 @@ let
in {
hosts = addNames {
wolf = {
#dc = "shack";
dc = "shack";
nets = {
#shack = {
# addrs4 = [ TODO ];
# aliases = ["wolf.shack"];
#};
shack = {
addrs4 = [ "10.42.2.136" ];
aliases = [
"wolf.shack"
"graphite.shack"
"acng.shack"
"drivedroid.shack"
];
};
retiolum = {
addrs4 = ["10.243.77.1"];
addrs6 = ["42:0:0:0:0:0:77:1"];

View File

@ -1,12 +1,31 @@
{ config, lib, pkgs, ... }:
let
shack-ip = lib.head config.krebs.build.host.nets.shack.addrs4;
internal-ip = lib.head config.krebs.build.host.nets.retiolum.addrs4;
in
{
imports = [
../2configs/base.nix
<nixpkgs/nixos/modules/profiles/qemu-guest.nix>
../2configs/collectd-base.nix
../2configs/shack-nix-cacher.nix
../2configs/shack-drivedroid.nix
];
networking = {
interfaces.eth0.ip4 = [{
address = shack-ip;
prefixLength = 20;
}];
defaultGateway = "10.42.0.1";
nameservers = [ "8.8.8.8" ];
};
#####################
# uninteresting stuff
#####################
krebs.build.host = config.krebs.hosts.wolf;
# TODO rename shared user to "krebs"
krebs.build.user = config.krebs.users.shared;
@ -31,7 +50,7 @@
fileSystems."/" = { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; };
swapDevices = [
{ device = "/dev/disk/by-label/swap"; }
{ device = "/dev/disk/by-label/swap"; }
];
time.timeZone = "Europe/Berlin";

View File

@ -0,0 +1,18 @@
{ pkgs, lib, ... }:
{
krebs.nginx = {
enable = lib.mkDefault true;
servers = {
drivedroid-repo = {
server-names = [ "drivedroid.shack" ];
# TODO: prepare this somehow
locations = lib.singleton (lib.nameValuePair "/" ''
root /var/srv/drivedroid
index main.json
'');
};
};
};
}

View File

@ -0,0 +1,25 @@
{ pkgs, lib, ... }:
{
krebs.nginx = {
enable = lib.mkDefault true;
servers = {
apt-cacher-ng = {
server-names = [ "acng.shack" ];
locations = lib.singleton (lib.nameValuePair "/" ''
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:3142/;
'');
};
};
};
krebs.apt-cacher-ng = {
enable = true;
port = 3142;
bindAddress = "localhost";
cacheExpiration = 30;
};
}