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 April 16, 2024 00:28
IP address arithmetic and validation in Nix
{ lib ? null, ... }:
let
net = {
ip = {
# add :: (ip | mac | integer) -> ip -> ip
#
# Examples: