From bbe8ad4e0520110545efae27be5f4256257ddd3d Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Thu, 16 Dec 2021 20:17:40 +0100 Subject: [PATCH 1/6] switch to networkd --- systems/LoutreOS/configuration.nix | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/systems/LoutreOS/configuration.nix b/systems/LoutreOS/configuration.nix index 5d42fee..8f30b39 100644 --- a/systems/LoutreOS/configuration.nix +++ b/systems/LoutreOS/configuration.nix @@ -46,16 +46,8 @@ hostName = "loutreos"; # Define your hostname. hostId = "7e66e347"; - dhcpcd = { - persistent = true; - extraConfig = '' - interface bouyges - metric 10 - noarp - interface enp0s21u2 - metric 999 - ''; - }; + useNetworkd = true; + useDHCP = false; vlans = { bouyges = { @@ -69,10 +61,10 @@ }; interfaces = { - eno1.useDHCP = false; bouyges = { # Adresse MAC BBox ? https://lafibre.info/remplacer-bbox/informations-de-connexion-ftth/msg598303/#msg598303 macAddress = "E8:AD:A6:21:73:68"; + useDHCP = true; }; eno2 = { ipv4.addresses = [ From 8f5fec46379d07ffb530ec25ce0f17301f5b5ed5 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Mon, 20 Dec 2021 08:33:43 +0100 Subject: [PATCH 2/6] rename bouygues interface --- systems/LoutreOS/configuration.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/systems/LoutreOS/configuration.nix b/systems/LoutreOS/configuration.nix index 8f30b39..67eb71c 100644 --- a/systems/LoutreOS/configuration.nix +++ b/systems/LoutreOS/configuration.nix @@ -50,7 +50,7 @@ useDHCP = false; vlans = { - bouyges = { + bouygues = { id = 100; interface = "eno1"; }; @@ -61,7 +61,7 @@ }; interfaces = { - bouyges = { + bouygues = { # Adresse MAC BBox ? https://lafibre.info/remplacer-bbox/informations-de-connexion-ftth/msg598303/#msg598303 macAddress = "E8:AD:A6:21:73:68"; useDHCP = true; @@ -78,10 +78,10 @@ }; }; - # NAT bouyges <-> eno2 + # NAT bouygues <-> eno2 nat = { enable = true; - externalInterface = "bouyges"; + externalInterface = "bouygues"; # Permet d'utiliser le SNAT plus rapide au lieu de MASQUERADE # externalIP = "0.0.0.0"; internalIPs = [ "10.30.0.0/16" "10.40.0.0/16" ]; From 51404a9f90e0ae908e370224a726448ba0e149ae Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Mon, 20 Dec 2021 08:34:21 +0100 Subject: [PATCH 3/6] set DHCP parameters --- systems/LoutreOS/configuration.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/systems/LoutreOS/configuration.nix b/systems/LoutreOS/configuration.nix index 67eb71c..90280ff 100644 --- a/systems/LoutreOS/configuration.nix +++ b/systems/LoutreOS/configuration.nix @@ -76,6 +76,7 @@ { address = "10.40.0.1"; prefixLength = 16; } ]; }; + enp0s21u2.useDHCP = true; }; # NAT bouygues <-> eno2 @@ -110,6 +111,11 @@ }; }; + systemd.network.networks = { + "40-bouygues".dhcpV4Config.RouteMetric = 1; + "40-enp0s21u2".dhcpV4Config.RouteMetric = 1024; + }; + services.dhcpd4 = { enable = true; interfaces = [ "eno2" "chinoiseries" ]; From 1383b829ad8a45c9284f624876d92ce7fe5ed422 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Mon, 20 Dec 2021 08:34:45 +0100 Subject: [PATCH 4/6] fix dhcp service --- systems/LoutreOS/configuration.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/systems/LoutreOS/configuration.nix b/systems/LoutreOS/configuration.nix index 90280ff..62e1c55 100644 --- a/systems/LoutreOS/configuration.nix +++ b/systems/LoutreOS/configuration.nix @@ -122,9 +122,7 @@ machines = [ { ethernetAddress = "50:c7:bf:b6:b8:ef"; hostName = "HS110"; ipAddress = "10.30.50.7"; } { ethernetAddress = "ac:1f:6b:4b:01:15"; hostName = "IPMI"; ipAddress = "10.30.1.1"; } - { ethernetAddress = "00:1f:c6:6e:d1:f1"; hostName = "minecraftos"; ipAddress = "10.30.135.35"; } - { ethernetAddress = "b4:2e:99:ed:24:26"; hostName = "paul-fixe"; ipAddress = "10.30.135.71"; } - { ethernetAddress = "20:47:da:fc:19:98"; hostName = "telephone-nyan"; ipAddress = "10.30.50.2"; } + { ethernetAddress = "b4:2e:99:ed:24:26"; hostName = "paul-fixe"; ipAddress = "10.30.50.1"; } #ESPHome { ethernetAddress = "e0:98:06:85:e9:ce"; hostName = "salonled"; ipAddress = "10.30.40.1"; } @@ -141,11 +139,11 @@ option subnet-mask 255.255.0.0; subnet 10.30.0.0 netmask 255.255.0.0 { option routers 10.30.0.1; - range 10.30.50.0 10.30.250.0; + range 10.30.100.0 10.30.200.0; } subnet 10.40.0.0 netmask 255.255.0.0 { option routers 10.40.0.1; - range 10.40.50.0 10.40.250.0; + range 10.40.100.0 10.40.200.0; } ''; }; From 9ec5fed7b6a5f29e7f79c79364dc7e25d577d901 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Mon, 20 Dec 2021 08:35:30 +0100 Subject: [PATCH 5/6] disable pgmanage service --- systems/LoutreOS/web.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/systems/LoutreOS/web.nix b/systems/LoutreOS/web.nix index 7828fea..a880437 100644 --- a/systems/LoutreOS/web.nix +++ b/systems/LoutreOS/web.nix @@ -229,7 +229,6 @@ in "sonarr.nyanlout.re" = authReverse 8989; "syncthing.nyanlout.re" = authReverse 8384; "jackett.nyanlout.re" = authReverse 9117; - "pgmanage.nyanlout.re" = authReverse config.services.pgmanage.port; "matrix.nyanlout.re" = simpleReverse 8008; "emby.nyanlout.re" = recursiveUpdate (simpleReverse 8096) { locations."/" = { @@ -306,14 +305,6 @@ in }; }; - pgmanage = { - enable = true; - port = 10006; - connections = { - localhost = "hostaddr=127.0.0.1 port=5432 dbname=postgres"; - }; - }; - gitea = { enable = true; cookieSecure = true; From 7de8b4703b72e40240c53515f565bc03b6aa11fd Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Mon, 20 Dec 2021 08:37:05 +0100 Subject: [PATCH 6/6] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file changes: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/573095944e7c1d58d30fc679c81af63668b54056' (2021-12-10) → 'github:NixOS/nixpkgs/e6377ff35544226392b49fa2cf05590f9f0c4b43' (2021-12-19) • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/a2e281f5770247855b85d70c43454ba5bff34613' (2021-12-14) → 'github:NixOS/nixpkgs/395879c28386e1abf20c7ecacd45880759548391' (2021-12-19) --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 9c9184f..188dc44 100644 --- a/flake.lock +++ b/flake.lock @@ -59,11 +59,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1639161226, - "narHash": "sha256-75Y08ynJDTq6HHGIF+8IADBJSVip0UyWQH7jqSFnRR8=", + "lastModified": 1639891440, + "narHash": "sha256-FJxa6ObwOQKZy3VhwN5bJRzX+MV/Yq9WLHK/4jlPKrs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "573095944e7c1d58d30fc679c81af63668b54056", + "rev": "e6377ff35544226392b49fa2cf05590f9f0c4b43", "type": "github" }, "original": { @@ -74,11 +74,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1639525045, - "narHash": "sha256-z4GXFNzO+5V4CAUm2DDMAryLOWUKEbQif2ifvv1Ypg4=", + "lastModified": 1639876010, + "narHash": "sha256-naGsoUfsY92NaIGiFI8XFXBnesw8BQGe694xcfaLMDI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a2e281f5770247855b85d70c43454ba5bff34613", + "rev": "395879c28386e1abf20c7ecacd45880759548391", "type": "github" }, "original": {