Skip to content

Instantly share code, notes, and snippets.

View matthewpi's full-sized avatar

Matthew Penner matthewpi

View GitHub Profile
@duairc
duairc / net.nix
Last active June 21, 2025 14:29
IP address arithmetic and validation in Nix
{ lib ? null, ... }:
let
net = {
ip = {
# add :: (ip | mac | integer) -> ip -> ip
#
# Examples: