diff options
| author | Karel Kočí <cynerd@email.cz> | 2025-12-01 11:22:23 +0100 |
|---|---|---|
| committer | Karel Kočí <cynerd@email.cz> | 2025-12-01 11:22:23 +0100 |
| commit | 54c6d3166c4c0f9464fbfd317eb03d164978277c (patch) | |
| tree | 43ac8194428e9b65b839733a3fd011bd28e9bc7b | |
| parent | 3f01585f9de574ae6ec6ae774e0b6f1455ed11f7 (diff) | |
| download | nixos-personal-54c6d3166c4c0f9464fbfd317eb03d164978277c.tar.gz nixos-personal-54c6d3166c4c0f9464fbfd317eb03d164978277c.tar.bz2 nixos-personal-54c6d3166c4c0f9464fbfd317eb03d164978277c.zip | |
lib: remove with usage
| -rw-r--r-- | flake.lock | 12 | ||||
| -rw-r--r-- | lib/default.nix | 5 | ||||
| -rw-r--r-- | lib/ipv4.nix | 7 |
3 files changed, 13 insertions, 11 deletions
@@ -193,11 +193,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1764080039, - "narHash": "sha256-b1MtLQsQc4Ji1u08f+C6g5XrmLPkJQ1fhNkCt+0AERQ=", + "lastModified": 1764440730, + "narHash": "sha256-ZlJTNLUKQRANlLDomuRWLBCH5792x+6XUJ4YdFRjtO4=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "da17006633ca9cda369be82893ae36824a2ddf1a", + "rev": "9154f4569b6cdfd3c595851a6ba51bfaa472d9f3", "type": "github" }, "original": { @@ -326,11 +326,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1763966396, - "narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=", + "lastModified": 1764517877, + "narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5ae3b07d8d6527c42f17c876e404993199144b6a", + "rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c", "type": "github" }, "original": { diff --git a/lib/default.nix b/lib/default.nix index 76eb693..d6024bc 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,5 +1,6 @@ -final: _: -with final; { +final: _: let + inherit (final) pow foldl genList id reverseList bitAnd pow2 length add zipListsWith; +in { # Generic power of number pow = base: e: if e == 0 diff --git a/lib/ipv4.nix b/lib/ipv4.nix index c843cb6..537525f 100644 --- a/lib/ipv4.nix +++ b/lib/ipv4.nix @@ -1,6 +1,7 @@ -lib: -with builtins; -with lib; rec { +lib: let + inherit (lib) int2bits toInt splitString flatten bits2int sublist genList zipListsWith; + inherit (lib.ipv4) ip2bits bits2ip netmaskBits int2ip ip2int prefix2ip; +in { # Converts string representation of IPv4 address to 32 bits ip2bits = ip: let perBits = map (x: int2bits 8 (toInt x)) (splitString "." ip); |
