Skip to content
Snippets Groups Projects
Commit d988da89 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

Add one of the 100TB machines - now working, wow.

parent 55f9c5cf
No related branches found
No related tags found
No related merge requests found
...@@ -24,4 +24,6 @@ in ...@@ -24,4 +24,6 @@ in
publicIPv4 = "209.95.51.251"; publicIPv4 = "209.95.51.251";
inherit publicStoragePort; inherit publicStoragePort;
}; };
"staging002" = import ./staging002.nix;
} }
{ "interface" = "eno1";
"publicIPv4" = "69.36.183.24";
"prefixLength" = 24;
"gateway" = "69.36.183.1";
"gatewayInterface" = "eno1";
"grubDeviceID" = "wwn-0x5000c500936410b9";
"rootPublicKey" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN4GenAY/YLGuf1WoMXyyVa3S9i4JLQ0AG+pt7nvcLlQ exarkun@baryon";
}
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "ehci_pci" "megaraid_sas" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/ccabaa39-d888-467e-b8d9-75b5790a91aa";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/849c8696-a7e6-42d2-810d-15326d9f9ff6";
fsType = "ext4";
};
fileSystems."/storage" =
{ device = "/dev/disk/by-uuid/2745cbf3-5a63-491d-ab92-6dfd4da1b504";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/c6f09c9a-572a-4b0f-b792-412cb5c749d4"; }
];
nix.maxJobs = lib.mkDefault 32;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}
{ config, pkgs, ... }:
{ imports =
[ # Include the results of the hardware scan.
./staging002-hardware.nix
# Configure it as a system operated by 100TB.
# Instance details are read from <hostName>.config.json
../nixos/modules/100tb.nix
];
"100tb".config = import ./staging002-config.nix;
# 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 = "19.03"; # Did you read the comment?
}
# A NixOS module which configures a system that is hosted by 100TB.
{ pkgs, lib, config, ... }:
let
cfg = config."100tb".config;
options = {
interface = lib.mkOption
{ type = lib.types.str;
example = lib.literalExample "eno0";
description = "The name of the network interface on which to configure a static address.";
};
publicIPv4 = lib.mkOption
{ type = lib.types.str;
example = lib.literalExample "192.0.2.0";
description = "The IPv4 address to statically assign to `interface`.";
};
prefixLength = lib.mkOption
{ type = lib.types.int;
example = lib.literalExample 24;
description = "The statically configured network's prefix length.";
};
gateway = lib.mkOption
{ type = lib.types.str;
example = lib.literalExample "192.0.2.1";
description = "The statically configured address of the network gateway.";
};
gatewayInterface = lib.mkOption
{ type = lib.types.str;
example = lib.literalExample "eno0";
description = "The name of the network interface for the default route.";
default = cfg.interface;
};
grubDeviceID = lib.mkOption
{ type = lib.types.str;
example = lib.literalExample "wwn-0x5000c500936410b9";
description = "The ID of the disk on which to install grub.";
};
rootPublicKey = lib.mkOption
{ type = lib.types.str;
example = lib.literalExample "ssh-ed25519 AAAA... username@host";
description = "The public key to install for the root user.";
};
};
in {
options =
{ "100tb".config = lib.mkOption
{ type = lib.types.submodule { inherit options; };
description = "Host-specific configuration relevant to a 100TB system.";
};
};
config =
{ boot.loader.timeout = 1;
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/disk/by-id/${cfg.grubDeviceID}";
# Let me in to do subsequent configuration.
networking.firewall.enable = false;
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = [
cfg.rootPublicKey
];
# Provide the static network configuration.
networking.dhcpcd.enable = false;
networking.interfaces = {
"${cfg.interface}".ipv4.addresses = [
{ address = cfg.publicIPv4; inherit (cfg) prefixLength; }
];
};
networking.defaultGateway = {
address = cfg.gateway;
interface = cfg.gatewayInterface;
};
networking.nameservers = [
"4.2.2.1"
"8.8.8.8"
];
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment