From 60f57166c9159f725121dbc4422dfc812daed227 Mon Sep 17 00:00:00 2001 From: Astro Date: Mon, 1 Apr 2019 03:10:00 +0200 Subject: [PATCH] add dhcp --- hosts/storage-ng/dhcp/configuration.nix | 39 +++++++++++++++++++++++++ secrets | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 hosts/storage-ng/dhcp/configuration.nix diff --git a/hosts/storage-ng/dhcp/configuration.nix b/hosts/storage-ng/dhcp/configuration.nix new file mode 100644 index 00000000..15e35494 --- /dev/null +++ b/hosts/storage-ng/dhcp/configuration.nix @@ -0,0 +1,39 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ ../../../lib/lxc-container.nix + ../../../lib/shared.nix + ]; + + networking.hostName = "dhcp"; + networking.defaultGateway = "172.22.99.1"; + networking.nameservers = [ "172.20.72.6" ]; + networking.interfaces.eth0 = { + ipv4.addresses = [ { + address = "172.22.99.254"; + prefixLength = 24; + } ]; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim + ]; + + # dhcp + networking.firewall.allowedUDPPorts = [ 67 68 ]; + + services.dhcpd4 = { + enable = true; + interfaces = [ "eth0" ]; + extraConfig = builtins.readFile ../../../secrets/hosts/dhcp/config; + }; + + # This value determines the NixOS release with which your system is to be + # compatible, in order to avoid breaking some software such as database + # servers. You should change this only after NixOS release notes say you + # should. + system.stateVersion = "18.09"; # Did you read the comment? +} diff --git a/secrets b/secrets index f43e4723..01dcefd9 160000 --- a/secrets +++ b/secrets @@ -1 +1 @@ -Subproject commit f43e472380ae045952c2f5c68d6da580f7b958d0 +Subproject commit 01dcefd917931d4c6f729e05d5e5f76060cfebc9