Some prep for suspend and swap

This commit is contained in:
Natsu Kagami 2022-10-21 14:16:06 +02:00
parent 47ae9d93be
commit 9260c068ab
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51
2 changed files with 18 additions and 1 deletions

View file

@ -202,6 +202,21 @@
services.dbus.packages = with pkgs; [ gcr ]; services.dbus.packages = with pkgs; [ gcr ];
# Power Management
powerManagement = {
enable = true;
powerDownCommands = ''
/run/current-system/sw/bin/rmmod brcmfmac # Disable wifi
/run/current-system/sw/bin/rmmod hci_bcm4377 # Disable bluetooth
'';
resumeCommands = ''
/run/current-system/sw/bin/modprobe brcmfmac # Enable wifi
/run/current-system/sw/bin/modprobe hci_bcm4377 # Enable bluetooth
/run/current-system/sw/bin/systemctl restart iwd
/run/current-system/sw/bin/systemctl restart bluetooth
'';
};
# Open ports in the firewall. # Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];

View file

@ -26,7 +26,9 @@
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [
{ device = "/swap"; size = 16 * 1024; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's