From 6dc38cf21e589df32c9b11046d40ea54a97bdd0e Mon Sep 17 00:00:00 2001 From: clerie Date: Sat, 23 Nov 2024 23:00:19 +0100 Subject: [PATCH 1/2] hosts/carbon: Add net-printer --- hosts/carbon/configuration.nix | 1 + hosts/carbon/net-printer.nix | 47 ++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 hosts/carbon/net-printer.nix diff --git a/hosts/carbon/configuration.nix b/hosts/carbon/configuration.nix index 34efa5a..b6d9ce7 100644 --- a/hosts/carbon/configuration.nix +++ b/hosts/carbon/configuration.nix @@ -14,6 +14,7 @@ ./net-iot.nix ./net-lte.nix ./net-mgmt.nix + ./net-printer.nix ./net-voip.nix ./ntp.nix ./ppp.nix diff --git a/hosts/carbon/net-printer.nix b/hosts/carbon/net-printer.nix new file mode 100644 index 0000000..bc32d16 --- /dev/null +++ b/hosts/carbon/net-printer.nix @@ -0,0 +1,47 @@ +{ ... }: + +{ + networking.vlans."enp1s0.206" = { + id = 206; + interface = "enp1s0"; + }; + networking.bridges."net-printer".interfaces = [ + "enp1s0.206" + ]; + networking.interfaces."net-printer".ipv4.addresses = [ + { address = "10.152.206.1"; prefixLength = 24; } + ]; + + services.kea.dhcp4 = { + settings = { + interfaces-config = { + interfaces = [ "net-printer" ]; + }; + subnet4 = [ + { + id = 206; + subnet = "10.152.206.0/24"; + pools = [ + { + pool = "10.152.206.100 - 10.152.206.240"; + } + ]; + option-data = [ + { + name = "routers"; + data = "10.152.206.1"; + } + ]; + } + ]; + }; + }; + + clerie.firewall.extraForwardFilterCommands = '' + # Allow access from Heimnetz to printer + ip46tables -A forward-filter -i net-heimnetz -o net-printer -j ACCEPT + ip46tables -A forward-filter -i net-printer -j DROP + ip46tables -A forward-filter -o net-printer -j DROP + ''; + +} From ec964956f34a469d8569a6430f0a55169c41c035 Mon Sep 17 00:00:00 2001 From: Flake Update Bot Date: Sun, 24 Nov 2024 03:03:03 +0100 Subject: [PATCH 2/2] Update nixpkgs 2024-11-24-02-03 --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 4f0c0ab..9e217be 100644 --- a/flake.lock +++ b/flake.lock @@ -288,11 +288,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1725983898, - "narHash": "sha256-4b3A9zPpxAxLnkF9MawJNHDtOOl6ruL0r6Og1TEDGCE=", + "lastModified": 1732014248, + "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1355a0cbfeac61d785b7183c0caaec1f97361b43", + "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", "type": "github" }, "original": {