nix-config/hosts/containers/dhcp/configuration.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

2019-04-01 03:10:00 +02:00
{ config, pkgs, lib, ... }:
{
2021-02-22 11:45:12 +01:00
imports = [
../../../lib/lxc-container.nix
../../../lib/shared.nix
../../../lib/admins.nix
];
2019-04-01 03:10:00 +02:00
networking.hostName = "dhcp";
networking.defaultGateway = "172.22.99.1";
2021-02-22 11:45:12 +01:00
networking.nameservers =
[ "172.20.73.8" "172.20.72.6" "172.20.72.10" "9.9.9.9" ];
2019-11-03 21:02:56 +01:00
networking.useDHCP = false;
2019-04-01 03:10:00 +02:00
networking.interfaces.eth0 = {
2021-02-22 11:45:12 +01:00
ipv4.addresses = [{
2019-04-01 03:10:00 +02:00
address = "172.22.99.254";
prefixLength = 24;
2021-02-22 11:45:12 +01:00
}];
2019-11-03 21:04:43 +01:00
useDHCP = lib.mkForce false;
2019-04-01 03:10:00 +02:00
};
# List packages installed in system profile. To search, run:
# $ nix search wget
2021-02-22 11:45:12 +01:00
environment.systemPackages = with pkgs; [ vim ];
2019-04-01 03:10:00 +02:00
# dhcp
networking.firewall.allowedUDPPorts = [ 67 68 ];
services.dhcpd4 = {
enable = true;
interfaces = [ "eth0" ];
extraConfig = ''
authoritative;
'' + builtins.readFile ../../../secrets/hosts/dhcp/config;
2019-04-01 03:10:00 +02:00
};
# 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?
}