summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-11-17 22:15:07 +0100
committermakefu <github@syntax-fehler.de>2015-11-17 22:15:07 +0100
commit5aed0a395b2f78216bc02a7178527034bb079d28 (patch)
tree3e10c7b22b6f58ba25de1fc120b032708fedd00b /shared
parenta4ab19181b312a64a14f7da694e994959ce2b147 (diff)
shared wolf: static ip, fix todo
Diffstat (limited to 'shared')
-rw-r--r--shared/1systems/wolf.nix21
-rw-r--r--shared/2configs/shack-drivedroid.nix18
-rw-r--r--shared/2configs/shack-nix-cacher.nix25
3 files changed, 63 insertions, 1 deletions
diff --git a/shared/1systems/wolf.nix b/shared/1systems/wolf.nix
index 4fe3388c8..30e6e1d07 100644
--- a/shared/1systems/wolf.nix
+++ b/shared/1systems/wolf.nix
@@ -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";
diff --git a/shared/2configs/shack-drivedroid.nix b/shared/2configs/shack-drivedroid.nix
new file mode 100644
index 000000000..294f3a369
--- /dev/null
+++ b/shared/2configs/shack-drivedroid.nix
@@ -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
+ '');
+ };
+ };
+ };
+
+}
diff --git a/shared/2configs/shack-nix-cacher.nix b/shared/2configs/shack-nix-cacher.nix
new file mode 100644
index 000000000..7519bb3ac
--- /dev/null
+++ b/shared/2configs/shack-nix-cacher.nix
@@ -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;
+ };
+}