mirror of
https://github.com/srid/nixos-config.git
synced 2026-07-16 22:01:33 +08:00
nw
This commit is contained in:
parent
66cc63d988
commit
43521a183f
3 changed files with 31 additions and 4 deletions
|
|
@ -28,18 +28,29 @@
|
|||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Wired (enp1s0) and Wi-Fi (drapeau/wlp2s0) are on the same LAN. Letting both
|
||||
# Wired (enp1s0) and Wi-Fi (wlp2s0) are on the same LAN. Letting both
|
||||
# autoconnect causes ARP flux: the gateway's neighbor entry for our IP flips
|
||||
# between the two NIC MACs and the Ethernet path goes silently dead.
|
||||
# See docs/LINUX-INTERNET-ISSUES.md.
|
||||
systemd.services.nm-drapeau-noautoconnect = {
|
||||
description = "Disable autoconnect on drapeau Wi-Fi profile";
|
||||
#
|
||||
# Disable autoconnect on *every* saved Wi-Fi profile (not a single hardcoded
|
||||
# SSID) so a newly-joined network can't slip past and bring Wi-Fi up beside
|
||||
# Ethernet. Wi-Fi stays usable on demand via `nmcli connection up <name>`.
|
||||
systemd.services.nm-wifi-noautoconnect = {
|
||||
description = "Disable autoconnect on all Wi-Fi profiles (avoid dual-NIC ARP flux)";
|
||||
after = [ "NetworkManager.service" ];
|
||||
wants = [ "NetworkManager.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = ''
|
||||
${pkgs.networkmanager}/bin/nmcli connection modify drapeau connection.autoconnect no || true
|
||||
nmcli=${pkgs.networkmanager}/bin/nmcli
|
||||
"$nmcli" -t -f TYPE,NAME connection show | while IFS=: read -r type name; do
|
||||
if [ "$type" = "802-11-wireless" ]; then
|
||||
"$nmcli" connection modify "$name" connection.autoconnect no || true
|
||||
fi
|
||||
done
|
||||
# Drop any Wi-Fi link that already came up, so the fix applies without a reboot.
|
||||
"$nmcli" device disconnect wlp2s0 || true
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
|||
16
modules/home/services/drishti/kolu-ci.nix
Normal file
16
modules/home/services/drishti/kolu-ci.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
# kolu-ci-1 .. kolu-ci-8
|
||||
ciHosts = map (n: "kolu-ci-${toString n}") (lib.range 1 8);
|
||||
in
|
||||
{
|
||||
# The CI hosts are reachable only *through* pureintent, so hop via ProxyJump.
|
||||
# `ssh kolu-ci-N` then works transparently — and so does drishti's agent
|
||||
# spawn / nix-system probe / `nix copy`, which are all just `ssh <host>`.
|
||||
# See drishti's "Hosts behind a bastion (SSH hops)" docs (PR #50).
|
||||
# NOTE: drishti forces BatchMode=yes, so pureintent must be key-based
|
||||
# (non-interactive) from wherever this runs — which it already is.
|
||||
programs.ssh.matchBlocks = lib.genAttrs ciHosts (_name: {
|
||||
proxyJump = "pureintent";
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue