Add multi-host configuration

based loosely on https://github.com/tom-on-the-internet/system-configuration
This commit is contained in:
Elnu 2022-10-09 19:09:47 -07:00
parent f554a9038b
commit 8f0f5b9bbf
13 changed files with 254 additions and 240 deletions

28
hosts/elnupad/default.nix Normal file
View file

@ -0,0 +1,28 @@
{ ... }:
{
imports = [ (import ./hardware-configuration.nix) ];
boot.loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
grub = {
efiSupport = true;
device = "nodev";
# 1024x768 is the closest supported resolution to X220's native 1366x768
# To see a list of supported GRUB resolutions, enter GRUB,
# press e, F2 to enter command mode, and then type videoinfo to see list
gfxmodeEfi = "1024x768";
};
};
networking.hostName = "elnupad";
time.timeZone = "America/Los_Angeles";
# Use X11 caps lock to escape remap in TTY
console.useXkbConfig = true;
services.xserver.xkbOptions = "caps:escape";
}

View file

@ -0,0 +1,39 @@
# 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, modulesPath, ... }:
{
imports = [ ];
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelModules = [ "kvm-intel" "coretemp" ];
boot.extraModulePackages = [ ];
hardware.enableAllFirmware = true;
hardware.enableRedistributableFirmware = true;
fileSystems = {
"/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

3
hosts/elnupad/home.nix Normal file
View file

@ -0,0 +1,3 @@
{ pkgs, ... }: {
}