nixos-config/config/hardware/wormhole0.nix

93 lines
2.1 KiB
Nix
Raw Normal View History

2022-03-16 09:49:54 -07:00
{ config, lib, pkgs, modulesPath, ... }:
with lib; {
2022-04-08 14:21:56 -07:00
system.stateVersion = "21.11";
2022-03-16 09:49:54 -07:00
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
2022-04-08 14:21:56 -07:00
availableKernelModules =
[ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
2022-03-16 09:49:54 -07:00
kernelModules = [ ];
};
loader = {
2022-04-08 14:21:56 -07:00
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
2022-03-16 09:49:54 -07:00
};
2022-04-08 14:21:56 -07:00
tmpOnTmpfs = false;
2022-03-16 09:49:54 -07:00
2022-04-08 14:21:56 -07:00
kernelModules = [ "kvm-intel" ];
2022-03-16 09:49:54 -07:00
extraModulePackages = [ ];
};
hardware = {
2022-04-08 14:21:56 -07:00
bluetooth.enable = false;
2022-03-16 09:49:54 -07:00
enableRedistributableFirmware = true;
};
fileSystems = {
"/" = {
2022-04-08 14:21:56 -07:00
device = "wormhole0-root";
fsType = "tmpfs";
options = [ "mode=755" "noexec" "noatime" "nodiratime" ];
2022-03-16 09:49:54 -07:00
};
"/boot" = {
2022-04-08 14:21:56 -07:00
device = "/dev/disk/by-label/WORMBOOT";
2022-03-16 09:49:54 -07:00
fsType = "vfat";
2022-04-08 14:21:56 -07:00
options = [ "noexec" "noatime" "nodiratime" ];
};
"/nix" = {
device = "/dev/disk/by-label/wormhole0-data";
fsType = "btrfs";
options = [ "subvol=@nix" "compress=zstd" "noatime" "nodiratime" ];
};
"/var/log" = {
device = "/dev/disk/by-label/wormhole0-data";
fsType = "btrfs";
options =
[ "subvol=@logs" "compress=zstd" "noatime" "nodiratime" "noexec" ];
};
"/state" = {
device = "/dev/disk/by-label/wormhole0-data";
fsType = "btrfs";
options =
[ "subvol=@state" "compress=zstd" "noatime" "nodiratime" "noexec" ];
2022-03-16 09:49:54 -07:00
};
};
2022-04-08 14:21:56 -07:00
swapDevices = [{ device = "/dev/disk/by-label/wormhole0-swap"; }];
2022-03-16 09:49:54 -07:00
networking = {
useDHCP = mkDefault false;
macvlans = {
intif0 = {
2022-04-08 14:21:56 -07:00
interface = "enp1s0";
mode = "bridge";
};
wormif0 = {
interface = "enp3s0";
2022-03-16 09:49:54 -07:00
mode = "bridge";
};
};
interfaces = {
2022-04-08 14:21:56 -07:00
enp1s0.useDHCP = false;
enp3s0.useDHCP = false;
intif0.macAddress =
pkgs.lib.network.generate-mac-address "wormhole0" "intif0";
wormif0.macAddress =
pkgs.lib.network.generate-mac-address "wormhole0" "wormif0";
2022-03-16 09:49:54 -07:00
};
};
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
}