Files
nixos/hosts/mm/default.nix
T

131 lines
2.7 KiB
Nix
Raw Normal View History

2023-05-05 11:29:38 -05:00
# Edit this configuration file to define what should be installed on
2023-05-05 15:59:59 -05:00
# your system. Help is available in the configuration.nix(5) man page
2023-05-05 11:29:38 -05:00
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
2023-05-05 15:59:59 -05:00
let
wanInterface = "enp2s0";
lanInterface = "enp1s0";
lanIpAddress = "10.177.1.1";
in
2023-05-05 11:29:38 -05:00
{
2023-05-05 15:59:59 -05:00
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
2023-05-05 11:29:38 -05:00
2023-05-05 12:49:17 -05:00
2023-05-05 15:59:59 -05:00
greg.home = false;
2023-05-05 12:49:17 -05:00
2023-05-05 15:59:59 -05:00
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
2023-05-05 11:29:38 -05:00
2023-05-05 15:59:59 -05:00
networking = {
hostName = "mm";
domain = "mindmazeroom.lan";
2023-05-05 17:30:12 -05:00
#nameservers = [ "127.0.0.53" ];
2023-05-05 15:59:59 -05:00
interfaces = {
"${wanInterface}".useDHCP = true;
"${lanInterface}" = {
useDHCP = false;
ipv4.addresses = [{
address = lanIpAddress;
prefixLength = 24;
}];
};
};
firewall = { # Might not strictly be necessary?
allowedTCPPorts = [ 53 ];
allowedUDPPorts = [ 53 67 ];
};
};
2023-05-05 11:29:38 -05:00
2023-05-05 15:59:59 -05:00
# Serves as the router, DHCP, and DNS for the site
greg.router = {
enable = true;
2023-05-05 17:30:12 -05:00
wan = [ wanInterface "tailscale0" ];
2023-05-05 15:59:59 -05:00
lan = [ lanInterface ];
};
2023-05-05 17:30:12 -05:00
greg.tailscale.enable = true;
2023-05-05 15:59:59 -05:00
services = {
2023-05-05 17:30:12 -05:00
dnsmasq = {
enable = true;
settings = {
domain = "mindmazeroom.lan";
server = [
"1.1.1.1"
"100.100.100.100"
"8.8.8.8"
];
};
2023-05-05 15:59:59 -05:00
};
create_ap = {
enable = false;
settings = {
INTERNET_IFACE = "";
WIFI_IFACE = "wlan0";
SSID = "MM_Test";
PASSPHRASE = "MindMaze2023";
};
};
kea.dhcp4 = {
enable = true;
settings = {
interfaces-config = {
interfaces = [ lanInterface ];
};
lease-database = {
name = "/var/lib/kea/dhcp4.leases";
persist = true;
type = "memfile";
};
renew-timer = 1000;
rebind-timer = 2000;
valid-lifetime = 4000;
option-data = [{
name = "domain-name-servers";
data = "${lanIpAddress}";
} {
name = "routers";
data = "10.177.1.1";
}];
subnet4 = [{
subnet = "10.177.1.0/24";
pools = [{
pool = "10.177.1.10-10.177.1.250";
}];
}];
};
};
2023-05-05 11:29:38 -05:00
2023-05-05 15:59:59 -05:00
# Configure keymap in X11
xserver = {
layout = "us";
xkbVariant = "";
};
};
2023-05-05 11:29:38 -05:00
2023-05-05 15:59:59 -05:00
# Set your time zone.
time.timeZone = "America/Chicago";
2023-05-05 11:29:38 -05:00
2023-05-05 15:59:59 -05:00
# Define a user account. Don't forget to set a password with passwd.
users.users.greg = {
isNormalUser = true;
description = "Greg Hellings";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [];
};
2023-05-05 11:29:38 -05:00
2023-05-05 15:59:59 -05:00
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
2023-05-05 11:29:38 -05:00
2023-05-05 15:59:59 -05:00
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
];
system.stateVersion = "22.05";
2023-05-05 11:29:38 -05:00
}