mrflos-nixos-config-fork/machines/MacBookPro12.1-hardware-configuration.nix

114 lines
3.3 KiB
Nix
Raw Permalink Normal View History

2023-04-08 20:50:35 +00:00
# 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.
2024-09-05 12:39:17 +00:00
{
config,
lib,
pkgs,
modulesPath,
...
}:
2023-04-08 20:50:35 +00:00
{
2024-09-05 12:39:17 +00:00
imports = [
(modulesPath + "/hardware/network/broadcom-43xx.nix")
(modulesPath + "/installer/scan/not-detected.nix")
];
2023-04-08 20:50:35 +00:00
2024-09-05 12:39:17 +00:00
boot.initrd.availableKernelModules = [
"xhci_pci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
2023-04-08 20:50:35 +00:00
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
2023-06-19 12:52:25 +00:00
boot.blacklistedKernelModules = [ ];
boot.extraModulePackages = with config.boot.kernelPackages; [
#rtl8192eu
];
2023-04-08 20:50:35 +00:00
2024-09-05 12:39:17 +00:00
fileSystems."/" = {
device = "/dev/disk/by-uuid/d56411cf-7072-48a8-aab7-70fb73695e64";
fsType = "ext4";
};
2023-04-08 20:50:35 +00:00
2024-09-05 12:39:17 +00:00
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/37E1-D07F";
fsType = "vfat";
};
fileSystems."/mnt/nas/music" = {
device = "192.168.1.2:/volume1/music";
options = [
"nfsvers=4.2"
"x-systemd.automount"
"noauto"
"rw"
"relatime"
"user"
"acl"
"defaults"
];
fsType = "nfs";
};
2023-11-03 08:09:19 +00:00
2023-08-13 16:18:11 +00:00
services.rpcbind.enable = true; # needed for NFS
2024-09-05 12:39:17 +00:00
systemd.mounts = [
{
type = "nfs";
mountConfig = {
Options = "defaults,acl,user,noauto,relatime,rw";
};
what = "192.168.1.2:/volume1/music";
where = "/mnt/nas/music";
}
];
2023-08-13 16:18:11 +00:00
2024-09-05 12:39:17 +00:00
systemd.automounts = [
{
wantedBy = [ "multi-user.target" ];
automountConfig = {
TimeoutIdleSec = "600";
};
where = "/mnt/nas/music";
}
];
2023-08-13 16:18:11 +00:00
2023-04-08 20:50:35 +00:00
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.wlp3s0.useDHCP = lib.mkDefault true;
2023-06-19 12:52:25 +00:00
#nixpkgs.config.allowBroken = true;
2023-04-08 20:50:35 +00:00
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
powerManagement = {
# Enable gradually increasing/decreasing CPU frequency, rather than using
# "powersave", which would keep CPU frequency at 0.8GHz.
cpuFreqGovernor = lib.mkDefault "conservative";
# brcmfmac being loaded during hibernation would not let a successful resume
# https://bugzilla.kernel.org/show_bug.cgi?id=101681#c116.
# Also brcmfmac could randomly crash on resume from sleep.
powerUpCommands = lib.mkBefore "${pkgs.kmod}/bin/modprobe brcmfmac && ${pkgs.kmod}/bin/modprobe brcmfmac_wcc";
powerDownCommands = lib.mkBefore "${pkgs.kmod}/bin/rmmod brcmfmac_wcc && ${pkgs.kmod}/bin/rmmod brcmfmac";
};
# USB subsystem wakes up MBP right after suspend unless we disable it.
services.udev.extraRules = lib.mkDefault ''
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"
'';
2023-11-03 08:09:19 +00:00
2024-09-05 12:37:23 +00:00
services.logind.extraConfig = ''
2023-11-03 08:09:19 +00:00
RuntimeDirectorySize=8G
HandleLidSwitchDocked=ignore
'';
2024-09-05 12:37:23 +00:00
}