I have a nixos box that I am using as an HTPC. It works well except I can’t seem to stop it from going to sleep. It never did this with the previous Linux distro I had on the same hardware so I know I must be missing some configuration somewhere.
I tried setting powerManagement.enable = false; but that doesn’t seemed to have stopped it.
Are you using GNOME3 desktop? Then you might need this:
# Disable the GNOME3/GDM auto-suspend feature that cannot be disabled in GUI!
# If no user is logged in, the machine will power down after 20 minutes.
systemd.targets.sleep.enable = false;
systemd.targets.suspend.enable = false;
systemd.targets.hibernate.enable = false;
systemd.targets.hybrid-sleep.enable = false;