@cryptotaxi247 / infra / commits / a7d0615d

macs: import new hardware, use ssh config for names

Graham Christensen committed Sep 28, 2019 at 20:55 UTC a7d0615da3075bcebfc6919342865f62da4088cf
9 files changed +120 -135
delft/network.nix
+15 -23
@@ -42,9 +42,8 @@ in {
42 eris = import ./eris.nix;
43 ceres = import ./ceres.nix;
44
45 -/*
45 mac1 = makeMac {
47 - ip = "10.254.2.1";
46 + ip = "mac1";
47 extra = {
48 imports = [
49 ../macs/nodes/mac1.nix
@@ -62,29 +61,16 @@ in {
61 };
62
63 mac3 = makeMac {
65 - ip = "10.254.2.3";
64 + ip = "mac3";
65 extra = {
66 imports = [
67 ../macs/nodes/mac3.nix
69 - ({ config, lib, ... }: {
70 - monitorama.enable = true;
71 - monitorama.hosts = let
72 - nums = lib.lists.range 1 9;
73 - paths = num: {
74 - "mac${toString num}-host" = "http://192.168.2.${toString (num + 100)}:9100/metrics";
75 - "mac${toString num}-guest" = "http://192.168.2.${toString (num + 100)}:9101/metrics";
76 - };
77 - overrides = {
78 - "mac3-guest" = "http://${config.macosGuest.network.interiorNetworkPrefix}.2:9100/metrics";
79 - };
80 - in (builtins.foldl' (a: b: a // b) {} (builtins.map paths nums)) // overrides;
81 - })
68 ];
69 };
70 };
71
72 mac4 = makeMac {
87 - ip = "10.254.2.4";
73 + ip = "mac4";
74 extra = {
75 imports = [
76 ../macs/nodes/mac4.nix
@@ -93,7 +79,7 @@ in {
79 };
80
81 mac5 = makeMac {
96 - ip = "10.254.2.5";
82 + ip = "mac5";
83 extra = {
84 imports = [
85 ../macs/nodes/mac5.nix
@@ -102,7 +88,7 @@ in {
88 };
89
90 mac6 = makeMac {
105 - ip = "10.254.2.6";
91 + ip = "mac6";
92 extra = {
93 imports = [
94 ../macs/nodes/mac6.nix
@@ -111,7 +97,7 @@ in {
97 };
98
99 mac7 = makeMac {
114 - ip = "10.254.2.7";
100 + ip = "mac7";
101 extra = {
102 imports = [
103 ../macs/nodes/mac7.nix
@@ -120,7 +106,7 @@ in {
106 };
107
108 mac8 = makeMac {
123 - ip = "10.254.2.8";
109 + ip = "mac8";
110 extra = {
111 imports = [
112 ../macs/nodes/mac8.nix
@@ -128,6 +114,12 @@ in {
114 };
115 };
116
131 - # mac9 never booted
132 - */
117 + mac9 = makeMac {
118 + ip = "mac9";
119 + extra = {
120 + imports = [
121 + ../macs/nodes/mac8.nix
122 + ];
123 + };
124 + };
125 }
macs/nodes/mac1.nix
+14 -12
@@ -1,22 +1,20 @@
1 +# Do not modify this file! It was generated by ‘nixos-generate-config’
2 +# and may be overwritten by future invocations. Please make changes
3 +# to /etc/nixos/configuration.nix instead.
4 { config, lib, pkgs, ... }:
5 +
6 {
7 + imports =
8 + [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
9 + ];
10
11 boot.loader.systemd-boot.enable = true;
12 boot.loader.efi.canTouchEfiVariables = true;
13
7 - services.openssh.enable = true;
8 -
9 - networking.hostId = "e81bb594";
10 - nixpkgs.config.allowUnfree = true;
11 - system.stateVersion = "18.09"; # Did you read the comment?
12 -
14 boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "firewire_ohci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
14 - boot.kernelModules = [ "kvm-intel" ];
15 -
16 - # The broadcom_sta is commented and wl, cfg80211 are blacklisted
17 - # to prevent spamming of wl_cfg80211 dmesg errors.
18 - boot.blacklistedKernelModules = [ "wl" "cfg80211" "mac80211" ];
19 - #boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
15 + boot.initrd.kernelModules = [ ];
16 + boot.kernelModules = [ "kvm-intel" "wl" ];
17 + boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
18
19 fileSystems."/" =
20 { device = "rpool/root";
@@ -33,4 +31,8 @@
31 ];
32
33 nix.maxJobs = lib.mkDefault 4;
34 +
35 + networking.hostId = "29bdef97";
36 + nixpkgs.config.allowUnfree = true;
37 + boot.supportedFilesystems = ["zfs"];
38 }
macs/nodes/mac2.nix
+18 -16
@@ -1,32 +1,34 @@
1 -{ lib, config, ... }:
1 +# Do not modify this file! It was generated by ‘nixos-generate-config’
2 +# and may be overwritten by future invocations. Please make changes
3 +# to /etc/nixos/configuration.nix instead.
4 +{ config, lib, pkgs, ... }:
5 +
6 {
3 - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
4 - boot.supportedFilesystems = [ "zfs" ];
5 - boot.kernelModules = [ "kvm-intel" "wl" ];
6 - boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
7 + imports =
8 + [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
9 + ];
10 +
11 boot.loader.systemd-boot.enable = true;
12 boot.loader.efi.canTouchEfiVariables = true;
13
14 +
15 + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
16 + boot.initrd.kernelModules = [ ];
17 + boot.kernelModules = [ "kvm-intel" "wl" ];
18 + boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
19 +
20 fileSystems."/" =
21 { device = "rpool/root";
22 fsType = "zfs";
23 };
24
25 fileSystems."/boot" =
16 - { device = "/dev/disk/by-label/boot";
26 + { device = "/dev/disk/by-uuid/8534-A160";
27 fsType = "vfat";
28 };
29
20 - swapDevices =
21 - [ { device = "/dev/disk/by-label/swap"; }
22 - ];
30 + swapDevices = [ ];
31
32 nix.maxJobs = lib.mkDefault 4;
25 -
26 - networking.hostId = "c9e18834";
27 - nixpkgs.config.allowUnfree = true;
28 -
29 - services.openssh.enable = true;
30 - system.stateVersion = "18.09";
31 -
33 + #powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
34 }
macs/nodes/mac3.nix
+15 -22
@@ -1,15 +1,21 @@
1 -{ lib, config, ... }: {
1 +# Do not modify this file! It was generated by ‘nixos-generate-config’
2 +# and may be overwritten by future invocations. Please make changes
3 +# to /etc/nixos/configuration.nix instead.
4 +{ config, lib, pkgs, ... }:
5 +
6 +{
7 imports =
8 [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
9 ];
10
6 - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
7 - boot.kernelModules = [ "kvm-intel" "wl" ];
8 - boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
11 + boot.loader.systemd-boot.enable = true;
12 + boot.loader.efi.canTouchEfiVariables = true;
13
10 - boot.supportedFilesystems = [ "zfs" ];
14
12 - nixpkgs.config.allowUnfree = true;
15 + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
16 + boot.initrd.kernelModules = [ ];
17 + boot.kernelModules = [ "kvm-intel" "wl" ];
18 + boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
19
20 fileSystems."/" =
21 { device = "rpool/root";
@@ -17,25 +23,12 @@
23 };
24
25 fileSystems."/boot" =
20 - { device = "/dev/disk/by-label/boot";
26 + { device = "/dev/disk/by-uuid/4AA9-36D1";
27 fsType = "vfat";
28 };
29
24 - swapDevices =
25 - [ { device = "/dev/disk/by-label/swap"; }
26 - ];
30 + swapDevices = [ ];
31
32 nix.maxJobs = lib.mkDefault 4;
29 - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
30 -
31 - networking.hostId = "03156864";
32 -
33 - boot.loader.systemd-boot.enable = true;
34 - boot.loader.efi.canTouchEfiVariables = true;
35 -
36 - networking.hostName = "mac3";
37 - services.openssh.enable = true;
38 -
39 - system.stateVersion = "18.09"; # Did you read the comment?
40 -
33 + #powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
34 }
macs/nodes/mac4.nix
+16 -10
@@ -1,6 +1,19 @@
1 +# Do not modify this file! It was generated by ‘nixos-generate-config’
2 +# and may be overwritten by future invocations. Please make changes
3 +# to /etc/nixos/configuration.nix instead.
4 { config, lib, pkgs, ... }:
5 +
6 {
7 + imports =
8 + [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
9 + ];
10 +
11 + boot.loader.systemd-boot.enable = true;
12 + boot.loader.efi.canTouchEfiVariables = true;
13 +
14 +
15 boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
16 + boot.initrd.kernelModules = [ ];
17 boot.kernelModules = [ "kvm-intel" "wl" ];
18 boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
19
@@ -10,19 +23,12 @@
23 };
24
25 fileSystems."/boot" =
13 - { device = "/dev/disk/by-label/boot";
26 + { device = "/dev/disk/by-uuid/BB3A-8582";
27 fsType = "vfat";
28 };
29
17 - swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];
30 + swapDevices = [ ];
31
32 nix.maxJobs = lib.mkDefault 4;
20 - boot.loader.systemd-boot.enable = true;
21 - boot.loader.efi.canTouchEfiVariables = true;
22 -
23 - services.openssh.enable = true;
24 -
25 - networking.hostId = "b73d17b0";
26 - nixpkgs.config.allowUnfree = true;
27 - system.stateVersion = "18.09"; # Did you read the comment?
33 + #powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
34 }
macs/nodes/mac5.nix
+9 -10
@@ -2,18 +2,18 @@
2 # and may be overwritten by future invocations. Please make changes
3 # to /etc/nixos/configuration.nix instead.
4 { config, lib, pkgs, ... }:
5 +
6 {
7 + imports =
8 + [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
9 + ];
10
11 boot.loader.systemd-boot.enable = true;
12 boot.loader.efi.canTouchEfiVariables = true;
13
10 - services.openssh.enable = true;
14
12 - system.stateVersion = "18.09"; # Did you read the comment?
13 - nixpkgs.config.allowUnfree = true;
14 - networking.hostId = "9d9a37de";
15 -
16 - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
15 + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
16 + boot.initrd.kernelModules = [ ];
17 boot.kernelModules = [ "kvm-intel" "wl" ];
18 boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
19
@@ -23,13 +23,12 @@
23 };
24
25 fileSystems."/boot" =
26 - { device = "/dev/disk/by-label/boot";
26 + { device = "/dev/disk/by-uuid/4395-C1C2";
27 fsType = "vfat";
28 };
29
30 - swapDevices =
31 - [ { device = "/dev/disk/by-label/swap"; }
32 - ];
30 + swapDevices = [ ];
31
32 nix.maxJobs = lib.mkDefault 4;
33 + #powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
34 }
macs/nodes/mac6.nix
+11 -16
@@ -1,3 +1,6 @@
1 +# Do not modify this file! It was generated by ‘nixos-generate-config’
2 +# and may be overwritten by future invocations. Please make changes
3 +# to /etc/nixos/configuration.nix instead.
4 { config, lib, pkgs, ... }:
5
6 {
@@ -5,10 +8,13 @@
8 [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
9 ];
10
8 - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
11 + boot.loader.systemd-boot.enable = true;
12 + boot.loader.efi.canTouchEfiVariables = true;
13 +
14 + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
15 + boot.initrd.kernelModules = [ ];
16 boot.kernelModules = [ "kvm-intel" "wl" ];
17 boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
11 - boot.supportedFilesystems = [ "zfs" ];
18
19 fileSystems."/" =
20 { device = "rpool/root";
@@ -16,23 +22,12 @@
22 };
23
24 fileSystems."/boot" =
19 - { device = "/dev/disk/by-label/boot";
25 + { device = "/dev/disk/by-uuid/9A50-4381";
26 fsType = "vfat";
27 };
28
23 - swapDevices =
24 - [ { device = "/dev/disk/by-label/swap"; }
25 - ];
29 + swapDevices = [ ];
30
31 nix.maxJobs = lib.mkDefault 4;
28 -
29 - networking.hostId = "0480d43b";
30 - nixpkgs.config.allowUnfree = true;
31 -
32 - boot.loader.systemd-boot.enable = true;
33 - boot.loader.efi.canTouchEfiVariables = true;
34 -
35 - services.openssh.enable = true;
36 -
37 - system.stateVersion = "18.09"; # Did you read the comment?
32 + #powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
33 }
macs/nodes/mac7.nix
+12 -17
@@ -1,3 +1,6 @@
1 +# Do not modify this file! It was generated by ‘nixos-generate-config’
2 +# and may be overwritten by future invocations. Please make changes
3 +# to /etc/nixos/configuration.nix instead.
4 { config, lib, pkgs, ... }:
5
6 {
@@ -5,34 +8,26 @@
8 [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
9 ];
10
8 - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
11 + boot.loader.systemd-boot.enable = true;
12 + boot.loader.efi.canTouchEfiVariables = true;
13 +
14 + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
15 + boot.initrd.kernelModules = [ ];
16 boot.kernelModules = [ "kvm-intel" "wl" ];
17 boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
11 - boot.supportedFilesystems = [ "zfs" ];
18 +
19 fileSystems."/" =
20 { device = "rpool/root";
21 fsType = "zfs";
22 };
23
24 fileSystems."/boot" =
18 - { device = "/dev/disk/by-label/boot";
25 + { device = "/dev/disk/by-uuid/D597-B4E6";
26 fsType = "vfat";
27 };
28
22 - swapDevices =
23 - [ { device = "/dev/disk/by-label/swap"; }
24 - ];
25 -
26 - networking.hostId = "a139a86e";
29 + swapDevices = [ ];
30
31 nix.maxJobs = lib.mkDefault 4;
29 - nixpkgs.config.allowUnfree = true;
30 -
31 - boot.loader.systemd-boot.enable = true;
32 - boot.loader.efi.canTouchEfiVariables = true;
33 -
34 - services.openssh.enable = true;
35 - system.stateVersion = "18.09"; # Did you read the comment?
36 -
37 -
32 + #powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
33 }
macs/nodes/mac8.nix
+10 -9
@@ -2,16 +2,18 @@
2 # and may be overwritten by future invocations. Please make changes
3 # to /etc/nixos/configuration.nix instead.
4 { config, lib, pkgs, ... }:
5 +
6 {
7 + imports =
8 + [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
9 + ];
10 +
11 boot.loader.systemd-boot.enable = true;
12 boot.loader.efi.canTouchEfiVariables = true;
13
9 - services.openssh.enable = true;
10 - system.stateVersion = "18.09"; # Did you read the comment?
11 - nixpkgs.config.allowUnfree = true;
12 - networking.hostId = "2f5fc3a0";
14
14 - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
15 + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
16 + boot.initrd.kernelModules = [ ];
17 boot.kernelModules = [ "kvm-intel" "wl" ];
18 boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
19
@@ -21,13 +23,12 @@
23 };
24
25 fileSystems."/boot" =
24 - { device = "/dev/disk/by-label/boot";
26 + { device = "/dev/disk/by-uuid/0C38-6740";
27 fsType = "vfat";
28 };
29
28 - swapDevices =
29 - [ { device = "/dev/disk/by-label/swap"; }
30 - ];
30 + swapDevices = [ ];
31
32 nix.maxJobs = lib.mkDefault 4;
33 + #powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
34 }