diff --git a/flake.lock b/flake.lock index cac61a9..c0d0c06 100644 --- a/flake.lock +++ b/flake.lock @@ -1522,12 +1522,13 @@ "pre-commit-hooks": "pre-commit-hooks_3" }, "locked": { - "lastModified": 1732192922, - "narHash": "sha256-xQO/3I99TFdiXTN5VoS28NpbNlCQWQUvxmPQHlfkzmU=", - "owner": "oddlama", - "repo": "nix-topology", - "rev": "2b107e98bbde932a363874e0ef5b1739a932bbc5", - "type": "github" + "lastModified": 1733919075, + "narHash": "sha256-qr0HiP+YEuMJWkEsM3KBQkIvfBjA4VFvV6gC43Ize2o=", + "ref": "refs/heads/fix-container-mvlan", + "rev": "f4f7786d315beb8d7c65665b7cfc7260a988d89f", + "revCount": 152, + "type": "git", + "url": "file:///home/patrick/repos/nix/nix-topology/fix-container-mvlan" }, "original": { "owner": "oddlama", diff --git a/hosts/desktopnix/default.nix b/hosts/desktopnix/default.nix index 5942e73..47f97e1 100644 --- a/hosts/desktopnix/default.nix +++ b/hosts/desktopnix/default.nix @@ -69,4 +69,5 @@ programs.streamcontroller.enable = true; hardware.opentabletdriver.enable = true; + topology.self.icon = "devices.desktop"; } diff --git a/hosts/elisabeth/default.nix b/hosts/elisabeth/default.nix index 2b56f16..84fd7c7 100644 --- a/hosts/elisabeth/default.nix +++ b/hosts/elisabeth/default.nix @@ -81,4 +81,5 @@ kexecTime = "1m"; }; }; + topology.self.interfaces.lan.network = "home"; } diff --git a/hosts/elisabeth/guests.nix b/hosts/elisabeth/guests.nix index 4be6160..f0688de 100644 --- a/hosts/elisabeth/guests.nix +++ b/hosts/elisabeth/guests.nix @@ -27,20 +27,13 @@ let actual = "actual"; firefly = "money"; homebox = "homebox"; - octoprint = "print"; invidious = "yt"; blog = "blog"; }; in "${domains.${hostName}}.${config.secrets.secrets.global.domains.web}"; # TODO hard coded elisabeth nicht so schön - ipOf = - hostName: - if hostName == "octoprint" then - #nodes.testienix.config.wireguard.elisabeth.ipv4 - "0.0.0.0" - else - nodes."elisabeth-${hostName}".config.wireguard.elisabeth.ipv4; + ipOf = hostName: nodes."elisabeth-${hostName}".config.wireguard.elisabeth.ipv4; in { services.netbird.server.proxy = @@ -161,7 +154,6 @@ in (blockOf "blog" { port = 80; }) (blockOf "homebox" { }) (proxyProtect "ollama" { } true) - (proxyProtect "octoprint" { } true) (proxyProtect "firefly" { port = 80; } true) (blockOf "apispotify" { port = 3000; diff --git a/hosts/maddy/default.nix b/hosts/maddy/default.nix index e1cd3ce..bb2a61b 100644 --- a/hosts/maddy/default.nix +++ b/hosts/maddy/default.nix @@ -16,4 +16,5 @@ "virtio_blk" ]; nixpkgs.hostPlatform = "x86_64-linux"; + topology.self.icon = "devices.cloud-server"; } diff --git a/hosts/mailnix/default.nix b/hosts/mailnix/default.nix index f142d11..1c387f3 100644 --- a/hosts/mailnix/default.nix +++ b/hosts/mailnix/default.nix @@ -33,4 +33,5 @@ createHome = false; }; users.groups.nix-build = { }; + topology.self.icon = "devices.cloud-server"; } diff --git a/hosts/patricknix/default.nix b/hosts/patricknix/default.nix index 1b3a3f1..7735331 100644 --- a/hosts/patricknix/default.nix +++ b/hosts/patricknix/default.nix @@ -44,4 +44,5 @@ "kvm" "nixos-test" ]; + topology.self.icon = "devices.laptop"; } diff --git a/nix/topology.nix b/nix/topology.nix index ffcd441..b1d7bdb 100644 --- a/nix/topology.nix +++ b/nix/topology.nix @@ -1 +1,182 @@ -{ } +{ config, ... }: +let + inherit (config.lib.topology) + mkInternet + mkRouter + mkConnection + mkSwitch + mkDevice + ; +in +{ + networks = { + home = { + name = "Heimnetz"; + cidrv4 = "192.168.178.0/24"; + }; + }; + nodes = { + internet = mkInternet { + connections = [ + (mkConnection "fritzbox" "wan1") + (mkConnection "mailnix" "lan01") + (mkConnection "maddy" "lan01") + ]; + }; + fritzbox = mkRouter "FritzBox" { + info = "FRITZ!Box 7520"; + interfaceGroups = [ + [ + "wan1" + ] + [ + "eth1" + "eth2" + "eth3" + ] + ]; + interfaces.eth1 = { + addresses = [ "192.168.178.1" ]; + network = "home"; + }; + connections.eth1 = mkConnection "switch-ganzoben" "eth1"; + }; + switch-ganzoben = mkSwitch "Switch Ganzoben" { + info = "TPLink 16 Port"; + interfaceGroups = [ + [ + "eth1" + "eth2" + "eth3" + "eth4" + "eth5" + "eth6" + "eth7" + "eth8" + "eth9" + "eth10" + "eth11" + "eth12" + "eth13" + "eth14" + "eth15" + "eth16" + ] + ]; + connections = { + eth2 = mkConnection "switch-waschkueche" "eth1"; + eth3 = mkConnection "switch-patrick" "eth5"; + eth4 = mkConnection "docking-station-ganzoben" "lan"; + eth5 = mkConnection "desktop-ganzoben" "lan"; + eth9 = mkConnection "drucker" "lan"; + eth10 = mkConnection "homematic" "lan"; + eth11 = mkConnection "raspberry-pi" "lan"; + eth12 = mkConnection "fernseher" "lan"; + eth16 = mkConnection "devolo" "lan"; + }; + }; + switch-waschkueche = mkSwitch "Switch Waschküche" { + info = "TPLink 8 Port"; + interfaceGroups = [ + [ + "eth1" + "eth2" + "eth3" + "eth4" + "eth5" + "eth6" + "eth7" + "eth8" + ] + ]; + connections = { + eth2 = mkConnection "switch-server" "eth1"; + eth3 = mkConnection "desktop-david" "lan"; + eth7 = mkConnection "solar-anlage" "lan"; + eth8 = mkConnection "solar-anlage" "lan"; + }; + }; + switch-server = mkSwitch "Switch Server" { + info = "TPLink 5 Port"; + interfaceGroups = [ + [ + "eth1" + "eth2" + "eth3" + "eth4" + "eth5" + ] + ]; + connections = { + eth2 = mkConnection "elisabeth" "lan01"; + eth3 = mkConnection "homematic-ip" "lan"; + eth4 = mkConnection "dect" "lan"; + eth5 = mkConnection "docking-station-keller" "lan"; + }; + }; + switch-patrick = mkSwitch "Switch Patrick" { + info = "5 Port"; + interfaceGroups = [ + [ + "eth1" + "eth2" + "eth3" + "eth4" + "eth5" + ] + ]; + connections = { + eth4 = mkConnection "desktopnix" "lan01"; + eth3 = mkConnection "patricknix" "lan01"; + }; + }; + docking-station-ganzoben = mkDevice "Docking Station Ganzoben" { + info = "Docking Station"; + interfaces.lan = { }; + }; + desktop-ganzoben = mkDevice "Desktop Ganzoben" { + info = "Desktop"; + interfaces.lan = { }; + }; + drucker = mkDevice "Drucker" { + info = "HP Drucker"; + interfaces.lan = { }; + }; + homematic = mkDevice "homematic" { + info = "Homematic zentrale"; + interfaces.lan = { }; + }; + raspberry-pi = mkDevice "RaspberryPi" { + info = "Raspberry-Pi 5"; + interfaces.lan = { }; + }; + fernseher = mkDevice "fernseher" { + info = "LG? Fernseher"; + interfaces.lan = { }; + }; + devolo = mkDevice "devolo" { + info = "devolo"; + interfaces.lan = { }; + }; + solar-anlage = mkDevice "solar" { + info = "solar anlage+batterie"; + interfaces.lan = { }; + }; + desktop-david = mkDevice "desktop-david" { + info = "Desktop"; + interfaces.lan = { }; + }; + homematic-ip = mkDevice "homematic-ip" { + info = "homematic-ip point"; + interfaces.lan = { }; + }; + dect = mkDevice "dect" { + info = "Teflon"; + interfaces.lan = { }; + }; + docking-station-keller = mkDevice "Docking-station Keller" { + info = "Für die kellerarbeiter"; + interfaces.lan = { }; + }; + }; +} diff --git a/secrets/secrets.nix.age b/secrets/secrets.nix.age index 2e12704..b6f93bf 100644 Binary files a/secrets/secrets.nix.age and b/secrets/secrets.nix.age differ diff --git a/users/patrick/Xorg/default.nix b/users/patrick/Xorg/default.nix index 2a28243..a86f281 100644 --- a/users/patrick/Xorg/default.nix +++ b/users/patrick/Xorg/default.nix @@ -28,7 +28,7 @@ lib.optionalAttrs (!minimal) { services.libinput = { enable = true; mouse = { - accelSpeed = "0.5"; + accelSpeed = "0.3"; accelProfile = "flat"; middleEmulation = false; }; diff --git a/users/patrick/programs/direnv.nix b/users/patrick/programs/direnv.nix index d447526..1715b97 100644 --- a/users/patrick/programs/direnv.nix +++ b/users/patrick/programs/direnv.nix @@ -2,6 +2,7 @@ hm.programs.direnv = { enable = true; nix-direnv.enable = true; + config.warn_timout = "1m"; }; hm.home.persistence."/state".directories = [ ".local/share/direnv"