I use nixos 20.09. For some reason cups service was crashing after first attempt to connect to /localhost:631
$ journalctl -xe
output read that:
gruod. 30 12:29:19 nixos cupsd: No valid Listen or Port lines were found in the configuration file.
The unit cups.service has successfully entered the 'dead' state.
gruod. 30 12:29:19 nixos systemd: cups.service: Start request repeated too quickly.
gruod. 30 12:29:19 nixos systemd: cups.service: Failed with result 'start-limit-hit'.
File cupsd.conf in /etc/cups/ was empty. I did not want to edit it so I tried to disable/enable printing service in configuration.nix, disable/enable firewall and ssl hoping that nixos will do the job, but it didn’t. It was quite strange because /etc/cups/ directory was deleted every time after rebuilding configuration with printing services disabled. I even temporarily switched from KDE to i3wm but it didn’t help neither. Finaly I added these lines
# Only listen for connections from the local machine.
… to cupsd.conf and cups started to work. It seems that cupsd.conf was not reset correctly after rebuild of nixos. Maybe state of the previous build was affecting new build but in that case the purity of build was compromised. Could someone check out the content of cupsd.conf in the fresh nixos instalation and post it here?
try this, check the solution from this post, adding this you should be able to login and test stuff, useful not only for testing this, but also any changes you do to your machine, and what to see if they work, or how they look.