From 7c15872af8ab867787478f3f44391cd36676ad3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Tue, 10 Oct 2023 13:37:17 +0200 Subject: [PATCH] refactor: move to network printing --- flake.lock | 16 ---------------- flake.nix | 2 -- hosts/default.nix | 1 - hosts/pie/default.nix | 1 - hosts/pie/dhcpd.nix | 5 +++++ hosts/pie/paperless.nix | 5 +++++ hosts/pie/printing.nix | 17 ----------------- hosts/pie/unbound.nix | 4 ++-- modules/printing/default.nix | 9 ++------- overlays/default.nix | 5 ----- 10 files changed, 14 insertions(+), 51 deletions(-) delete mode 100644 hosts/pie/printing.nix diff --git a/flake.lock b/flake.lock index 5c81ed7..34b6545 100644 --- a/flake.lock +++ b/flake.lock @@ -272,21 +272,6 @@ "type": "github" } }, - "hl3140cw-arm": { - "locked": { - "lastModified": 1696674831, - "narHash": "sha256-FJmtrlRWJ76GwSaUB/Y7UCkfqgYh7wsnLOgVe15YvqU=", - "ref": "refs/heads/feat/brother-hl3140cw-on-arm", - "rev": "060f8d9b2493166afc9a48e274ea38cbefb38549", - "revCount": 533407, - "type": "git", - "url": "https://git.pub.solar/b12f/nixpkgs.git?branch=feat%2fbrotherhl3140cw-on-arm" - }, - "original": { - "type": "git", - "url": "https://git.pub.solar/b12f/nixpkgs.git?branch=feat%2fbrotherhl3140cw-on-arm" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -493,7 +478,6 @@ "deploy-rs": "deploy-rs", "flake-compat": "flake-compat", "flake-parts": "flake-parts", - "hl3140cw-arm": "hl3140cw-arm", "home-manager": "home-manager", "mobile-nixos": "mobile-nixos", "musnix": "musnix", diff --git a/flake.nix b/flake.nix index 7c05160..ff30eac 100644 --- a/flake.nix +++ b/flake.nix @@ -36,8 +36,6 @@ adblock-unbound.url = "github:MayNiklas/nixos-adblock-unbound"; adblock-unbound.inputs.nixpkgs.follows = "nixpkgs"; - - hl3140cw-arm.url = "git+https://git.pub.solar/b12f/nixpkgs.git?branch=feat/brotherhl3140cw-on-arm"; }; outputs = inputs@{ self, ... }: diff --git a/hosts/default.nix b/hosts/default.nix index b4a9ab8..bf25950 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -58,7 +58,6 @@ inputs.nixos-hardware.nixosModules.raspberry-pi-4 ./pie self.nixosModules.yule - self.nixosModules.printing self.nixosModules.docker ]; }; diff --git a/hosts/pie/default.nix b/hosts/pie/default.nix index 196f600..1604b59 100644 --- a/hosts/pie/default.nix +++ b/hosts/pie/default.nix @@ -4,7 +4,6 @@ ./configuration.nix ./networking.nix - ./printing.nix ./unbound.nix ./dhcpd.nix ./wake-droppie.nix diff --git a/hosts/pie/dhcpd.nix b/hosts/pie/dhcpd.nix index cf0a119..adc2ebe 100644 --- a/hosts/pie/dhcpd.nix +++ b/hosts/pie/dhcpd.nix @@ -47,6 +47,11 @@ ]; reservations = [ + { + hostname = "brwb8763f64a364.local"; + hw-address = "b8:76:3f:64:a3:64"; + ip-address = "192.168.178.4"; + } { hostname = "droppie.local"; hw-address = "08:f1:ea:97:0f:0c"; diff --git a/hosts/pie/paperless.nix b/hosts/pie/paperless.nix index 9dc8eaa..8518a03 100644 --- a/hosts/pie/paperless.nix +++ b/hosts/pie/paperless.nix @@ -28,6 +28,11 @@ in { }; }; + hardware.sane = { + enable = true; + extraBackends = [pkgs.hplipWithPlugin]; + }; + users.users."${psCfg.user.name}".packages = with pkgs; [ scan2paperless sane-backends diff --git a/hosts/pie/printing.nix b/hosts/pie/printing.nix deleted file mode 100644 index 15a90ea..0000000 --- a/hosts/pie/printing.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - flake, - config, - pkgs, - lib, - ... -}: { - services.caddy = { - enable = true; - extraConfig = '' - cups.b12f.io:80 { - request_header Host localhost:631 - reverse_proxy unix//run/cups/cups.sock - } - ''; - }; -} diff --git a/hosts/pie/unbound.nix b/hosts/pie/unbound.nix index 2d8b66a..4da3659 100644 --- a/hosts/pie/unbound.nix +++ b/hosts/pie/unbound.nix @@ -23,6 +23,8 @@ "\"box\" static" ]; local-data = [ + "\"brwb8763f64a364.local. 10800 IN A 192.168.178.4\"" + "\"droppie.local. 10800 IN A 192.168.178.3\"" "\"droppie.local. 10800 IN AAAA 2a02:908:5b1:e3c0:3077:4e39:7763:b5b8\"" "\"droppie.b12f.io. 10800 IN A 192.168.178.3\"" @@ -40,8 +42,6 @@ "\"firefly-importer.b12f.io. 10800 IN AAAA 2a02:908:5b1:e3c0:3077:4e39:7763:b5b7\"" "\"paperless.b12f.io. 10800 IN A 192.168.178.2\"" "\"paperless.b12f.io. 10800 IN AAAA 2a02:908:5b1:e3c0:3077:4e39:7763:b5b7\"" - "\"cups.b12f.io. 10800 IN A 192.168.178.2\"" - "\"cups.b12f.io. 10800 IN AAAA 2a02:908:5b1:e3c0:3077:4e39:7763:b5b7\"" "\"fritz.box. 10800 IN A 192.168.178.1\"" "\"fritz.box. 10800 IN AAAA fd00::3ea6:2fff:fe57:30b0\"" diff --git a/modules/printing/default.nix b/modules/printing/default.nix index 2ae6c9a..b41e34a 100644 --- a/modules/printing/default.nix +++ b/modules/printing/default.nix @@ -14,18 +14,13 @@ services.printing.enable = true; services.printing.browsing = true; services.printing.listenAddresses = ["localhost:631"]; - services.printing.allowFrom = ["all"]; - services.printing.defaultShared = false; + services.printing.defaultShared = lib.mkDefault false; + services.printing.drivers = [ pkgs.gutenprint pkgs.cups-brother-hl3140cw ]; - hardware.sane = { - enable = true; - extraBackends = [pkgs.hplipWithPlugin]; - }; - networking.hosts = flake.self.lib.addLocalHostname ["cups.local"]; services.caddy = { diff --git a/overlays/default.nix b/overlays/default.nix index 6f3e7f3..8d11a57 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -10,11 +10,6 @@ (final: prev: { nixd = inputs.nixpkgs-unstable.legacyPackages.${prev.system}.nixd; - cups-brother-hl3140cw = (import inputs.hl3140cw-arm { - system = prev.system; - config.allowUnfree = true; - }).cups-brother-hl3140cw; - factorio-headless = inputs.nixpkgs-master.legacyPackages.${prev.system}.factorio-headless; paperless-ngx = inputs.nixpkgs-master.legacyPackages.${prev.system}.paperless-ngx; waybar = inputs.nixpkgs-master.legacyPackages.${prev.system}.waybar;