ソースを参照

add dhcp

container/radius
Astro 2年前
コミット
60f57166c9
2個のファイルの変更40行の追加1行の削除
  1. 39
    0
      hosts/storage-ng/dhcp/configuration.nix
  2. 1
    1
      secrets

+ 39
- 0
hosts/storage-ng/dhcp/configuration.nix ファイルの表示

@@ -0,0 +1,39 @@
1
+{ config, pkgs, lib, ... }:
2
+
3
+{
4
+  imports =
5
+    [ ../../../lib/lxc-container.nix
6
+      ../../../lib/shared.nix
7
+    ];
8
+
9
+  networking.hostName = "dhcp";
10
+  networking.defaultGateway = "172.22.99.1";
11
+  networking.nameservers = [ "172.20.72.6" ];
12
+  networking.interfaces.eth0 = {
13
+    ipv4.addresses = [ {
14
+      address = "172.22.99.254";
15
+      prefixLength = 24;
16
+    } ];
17
+  };
18
+
19
+  # List packages installed in system profile. To search, run:
20
+  # $ nix search wget
21
+  environment.systemPackages = with pkgs; [
22
+    vim
23
+  ];
24
+
25
+  # dhcp
26
+  networking.firewall.allowedUDPPorts = [ 67 68 ];
27
+
28
+  services.dhcpd4 = {
29
+    enable = true;
30
+    interfaces = [ "eth0" ];
31
+    extraConfig = builtins.readFile ../../../secrets/hosts/dhcp/config;
32
+  };
33
+
34
+  # This value determines the NixOS release with which your system is to be
35
+  # compatible, in order to avoid breaking some software such as database
36
+  # servers. You should change this only after NixOS release notes say you
37
+  # should.
38
+  system.stateVersion = "18.09"; # Did you read the comment?
39
+}

+ 1
- 1
secrets

@@ -1 +1 @@
1
-Subproject commit f43e472380ae045952c2f5c68d6da580f7b958d0
1
+Subproject commit 01dcefd917931d4c6f729e05d5e5f76060cfebc9

読み込み中…
キャンセル
保存