summaryrefslogtreecommitdiff
path: root/modules/root
diff options
context:
space:
mode:
authorTim Keller <tjkeller.xyz>2024-10-31 18:58:47 -0500
committerTim Keller <tjkeller.xyz>2024-10-31 18:58:47 -0500
commit5cd716012f0a75a9f740b90d4afe7a205dee1b3b (patch)
tree0be57e514dedf8eee06b601522e918c9381dd6cb /modules/root
parent9675b81889f3e5b9a6b839eb91a4d0dafa528b43 (diff)
downloadnixos-5cd716012f0a75a9f740b90d4afe7a205dee1b3b.tar.xz
nixos-5cd716012f0a75a9f740b90d4afe7a205dee1b3b.zip
printers scanner setup and few other minor things
Diffstat (limited to 'modules/root')
-rw-r--r--modules/root/default.nix6
-rw-r--r--modules/root/hosts.nix6
-rw-r--r--modules/root/powerkeys.nix3
-rw-r--r--modules/root/printing.nix49
4 files changed, 58 insertions, 6 deletions
diff --git a/modules/root/default.nix b/modules/root/default.nix
index fb327e6..bd30787 100644
--- a/modules/root/default.nix
+++ b/modules/root/default.nix
@@ -2,7 +2,6 @@
imports = [
./autologin.nix
./awesome.nix
- ./cups.nix
./doas.nix
./docker.nix
./fonts.nix
@@ -14,6 +13,7 @@
./normaluser.nix
./pipewire.nix
./powerkeys.nix
+ ./printing.nix
./secrets.nix
./software.nix
./virtualisation.nix
@@ -22,7 +22,7 @@
];
autologin.enable = lib.mkDefault true;
- cups.enable = lib.mkDefault true;
+ avahi.enable = lib.mkDefault true;
doas.enable = lib.mkDefault true;
docker = {
enable = lib.mkDefault false;
@@ -36,6 +36,8 @@
};
home-manager.enable = lib.mkDefault true;
pipewire.enable = lib.mkDefault true;
+ printing.enable = lib.mkDefault true;
+ scanning.enable = lib.mkDefault true;
software = {
desktop = {
enable = lib.mkDefault true;
diff --git a/modules/root/hosts.nix b/modules/root/hosts.nix
index 17e9cac..27422ee 100644
--- a/modules/root/hosts.nix
+++ b/modules/root/hosts.nix
@@ -1,5 +1,5 @@
{
- networking.extraHosts = ''
- 192.168.1.30 localgit
- '';
+ networking.hosts = {
+ "192.168.1.30" = [ "localgit" ];
+ };
}
diff --git a/modules/root/powerkeys.nix b/modules/root/powerkeys.nix
index dcb3616..0a47cde 100644
--- a/modules/root/powerkeys.nix
+++ b/modules/root/powerkeys.nix
@@ -1,7 +1,8 @@
{
services.logind = {
+ hibernateKey = "suspend";
+ lidSwitch = "suspend";
powerKey = "ignore";
powerKeyLongPress = "poweroff";
- hibernateKey = "suspend";
};
}
diff --git a/modules/root/printing.nix b/modules/root/printing.nix
new file mode 100644
index 0000000..69ff573
--- /dev/null
+++ b/modules/root/printing.nix
@@ -0,0 +1,49 @@
+{ lib, config, pkgs, ... }: {
+ options = {
+ printing.enable = lib.mkEnableOption "enables printing";
+ avahi.enable = lib.mkEnableOption "enables avahi";
+ scanning.enable = lib.mkEnableOption "enables scanning";
+ };
+
+ config = lib.mkIf config.printing.enable {
+ services.printing = {
+ enable = true;
+ drivers = [
+ pkgs.epson-escpr2
+ ];
+ };
+
+ services.avahi = {
+ enable = true;
+ nssmdns4 = true;
+ openFirewall = true;
+ };
+
+ environment.systemPackages = with pkgs; pkgs.lib.optionals config.scanning.enable [
+ epsonscan2
+ ];
+
+ networking.hosts = {
+ "192.168.1.35" = [ "Epson_ET-8500" ];
+ "192.168.77.40" = [ "Xerox_WorkCentre_7855" ];
+ };
+
+ hardware.printers.ensurePrinters = [
+ {
+ name = "Epson_ET-8500";
+ description = "Epson ET-8500";
+ location = "Home";
+ deviceUri = "ipp://Epson_ET-8500:631/ipp/print";
+ model = "epson-inkjet-printer-escpr2/Epson-ET-8500_Series-epson-escpr2-en.ppd";
+ }
+ #{
+ # name = "Xerox_WorkCentre_7855";
+ # description = "Xerox WorkCentre 7855";
+ # location = "Office";
+ # deviceUri = "ipp://Xerox_WorkCentre_7855:631/ipp/print";
+ # model = "everywhere IPP Everywhere";
+ #}
+ ];
+ hardware.printers.ensureDefaultPrinter = "Epson_ET-8500";
+ };
+}