Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ inputs.org-pkgs.url = "github:external-systems/pkgs/<immutable-rev>";
nix-vscode-extensions, this flake's only non-core inputs) are also
exported separately. Applying the default overlay gives you the pinned
artifacts as `pkgs.rke2` / `pkgs.k3s_1_36` / `pkgs.ifstate`.
`overlays.ifstate` is the host-networking set: IfState 2.5.1 and a
patched `dhcpcd` (two upstream fixes for lost leases after a carrier
change on 10.3.x; dropped automatically from 10.5). A package that
needs a patch nixpkgs does not carry yet is patched here, never in a
consumer repo. The builder
`overlays.ifstate` is the host-networking set: IfState 2.5.1 and two
dhcpcd attributes. nixpkgs ships dhcpcd 10.3.2, which loses leases
after a carrier change and has four CVEs. `dhcpcd_latest` is the
unpatched upstream 10.5.2; clanServices netif runs it. `dhcpcd` stays
10.3.2 with the two upstream lost-lease commits, because 10.5 does
not start under the NixOS `dhcpcd.service` until nixpkgs#562813
lands. Both overrides drop out once nixpkgs catches up. A package
nixpkgs ships too old or broken is fixed here, never in a consumer
repo: the upstream release when it works, a patch only when it does
not. The builder
expressions come from the consumer's nixpkgs: rke2 needs any nixpkgs
shipping `pkgs/applications/networking/cluster/rke2/builder.nix` (all
version data is pinned locally in `pkgs/rke2/versions/`); k3s rides the
Expand Down
1 change: 1 addition & 0 deletions flake-parts/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
(artifactPkgs)
ifstate
dhcpcd
dhcpcd_latest
rke2
rke2_1_35
rke2_1_36
Expand Down
42 changes: 34 additions & 8 deletions overlays/ifstate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,40 @@ in {
};
});

# dhcpcd is the DHCP client IfState hooks start (clanServices netif).
# 10.3.x closes a DHCPv6 address socket before deleting it from its
# event loop. The stale entry makes the next socket that reuses the
# descriptor number fail with "eloop_event_add: No such file or
# directory", and DHCPv4 or DHCPv6 then does not recover after a
# carrier change. Upstream fixed both halves in 10.5.0
# (NetworkConfiguration/dhcpcd#611); these are those two commits. The
# version guard drops them once nixpkgs ships 10.5 or newer.
# dhcpcd, two attributes. nixpkgs ships 10.3.2, which closes a DHCPv6
# address socket before deleting it from its event loop: after a
# carrier change DHCPv4 or DHCPv6 does not recover ("eloop_event_add:
# No such file or directory", NetworkConfiguration/dhcpcd#596).
# Upstream fixed it in 10.5.0, with four CVEs (CVE-2026-56113,
# -56114, -56116, -56117).
#
# `dhcpcd_latest` is the unpatched upstream 10.5.2 on the nixpkgs
# build recipe. clanServices netif runs it: netif starts dhcpcd from
# an IfState hook, not from the NixOS `dhcpcd.service`. `patches` is
# emptied on purpose: a fix nixpkgs backports to its older version
# would not apply to this source.
dhcpcd_latest =
if final.lib.versionOlder prev.dhcpcd.version "10.5.2"
then
prev.dhcpcd.overrideAttrs (_: {
version = "10.5.2";
patches = [];
src = final.fetchFromGitHub {
owner = "NetworkConfiguration";
repo = "dhcpcd";
tag = "v10.5.2";
hash = "sha256-lrV6SaB/HmTptZigZ1Lf28eUPz0igxyT6omZwXDSuGM=";
};
})
else prev.dhcpcd;

# `dhcpcd` stays 10.3.2 with the two upstream commits of the lost-lease
# fix (NetworkConfiguration/dhcpcd#611). It cannot be 10.5 yet: from
# 10.5.1 dhcpcd calls chown on its control socket, and the system-call
# filter of the NixOS `dhcpcd.service` kills it at start ("dhcpcd
# manager hungup"; NixOS/nixpkgs#562813 adds `@chown`). A machine with
# `networking.useDHCP` would lose DHCP. The version guard drops the
# patches once nixpkgs ships 10.5 with that unit.
dhcpcd = prev.dhcpcd.overrideAttrs (old: {
patches =
(old.patches or [])
Expand Down
Loading