nixos-config/config/hardware/zbox.nix

115 lines
2.5 KiB
Nix

{ config, lib, pkgs, ... }:
{
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
initrd = {
availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
kernelModules = [ ];
};
kernelModules = [ "kvm-intel" ];
# kernelPackages = pkgs.linuxPackages_latest;
extraModulePackages = [ ];
};
system.stateVersion = "21.05";
fileSystems = {
"/" = {
device = "zbox-root";
fsType = "tmpfs";
options = [ "mode=755" ];
};
"/boot" = {
device = "/dev/disk/by-label/ZBOX-BOOT";
fsType = "vfat";
options = [ "noexec" "noatime" "nodiratime" ];
};
"/state" = {
device = "/dev/disk/by-label/zbox-data";
fsType = "btrfs";
options =
[ "noatime" "nodiratime" "compress=zstd" "noexec" "subvol=@state" ];
};
"/nix" = {
device = "/dev/disk/by-label/zbox-data";
fsType = "btrfs";
options = [ "noatime" "nodiratime" "compress=zstd" "subvol=@nix" ];
};
"/var/log" = {
device = "/dev/disk/by-label/zbox-data";
fsType = "btrfs";
options =
[ "noatime" "nodiratime" "compress=zstd" "noexec" "subvol=@logs" ];
};
"/home" = {
device = "/dev/disk/by-label/zbox-data";
fsType = "btrfs";
options = [ "noatime" "nodiratime" "compress=zstd" "subvol=@home" ];
};
};
swapDevices = [{ device = "/dev/disk/by-label/zbox-swap"; }];
hardware = {
bluetooth.enable = true;
cpu.intel.updateMicrocode = true;
opengl = {
driSupport = true;
driSupport32Bit = true;
setLdLibraryPath = true;
};
pulseaudio = {
support32Bit = true;
package = pkgs.pulseaudioFull;
};
enableRedistributableFirmware = true;
enableAllFirmware = true;
# Required with Wayland?
nvidia.modesetting.enable = true;
};
networking = {
macvlans = {
intif0 = {
interface = "eno1";
mode = "bridge";
};
};
interfaces = {
intif0 = {
# output of: echo clunk-intif0|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/'
macAddress = "02:dd:80:52:83:9b";
};
};
};
services.xserver.videoDrivers = [ "nvidia" ];
nix.maxJobs = lib.mkDefault 8;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
systemd.targets = {
sleep.enable = false;
suspend.enable = false;
hibernate.enable = false;
hybrid-sleep.enable = false;
};
}