Installing CUPS on NixOS
CUPS (Common Unix Printing System) is a printing system designed for Unix-like operating systems. This tutorial will cover the steps to install CUPS on NixOS.
Prerequisites
To follow this tutorial, you will need the following:
- A computer running NixOS Latest
- A working internet connection
Step 1: Update your system
Before we can start installing CUPS, we need to update the system.
sudo nix-channel --update
sudo nixos-rebuild switch
This will update your system to the latest version.
Step 2: Install CUPS
We can install CUPS using the Nix package manager. Open a terminal and type:
sudo nix-env -i cups
This will install CUPS on your system.
Step 3: Configure CUPS
CUPS needs to be configured before it can be used. To do this, we need to edit the CUPS configuration file. Open a terminal and type:
sudo nano /etc/cups/cupsd.conf
Find the line:
Listen localhost:631
and replace it with:
Port 631
Listen /var/run/cups.sock
Save and close the file.
Next, we need to allow access to the CUPS administration interface. This can be done by adding your user to the CUPS system group. Open a terminal and type:
sudo usermod -a -G cups yourusername
Replace "yourusername" with your actual username.
Step 4: Start CUPS
Finally, we need to start the CUPS service. Open a terminal and type:
sudo systemctl start cups.service
CUPS should now be up and running.
Step 5: Test printing
To test if CUPS is working, open a document and try to print it. You should see the CUPS printer interface. Select your printer and click "Print". If everything is working, your document should start printing.
Conclusion
That's it! You have successfully installed CUPS on NixOS and can now use it for all your printing needs. If you encounter any issues, consult the CUPS documentation or seek help from the NixOS community.