From 59551461e646c6f21b9a4b9093321145940ab7a5 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 4 Feb 2026 00:17:14 +0100 Subject: [PATCH] lib: Refactor --- flake-parts/lib.nix | 20 ++++++++++++++++---- lib/default.nix | 20 -------------------- 2 files changed, 16 insertions(+), 24 deletions(-) delete mode 100644 lib/default.nix diff --git a/flake-parts/lib.nix b/flake-parts/lib.nix index 97d0fee..5922d99 100644 --- a/flake-parts/lib.nix +++ b/flake-parts/lib.nix @@ -1,7 +1,19 @@ -{ self, inputs, ... }: +{ self, lib, ... }: { - flake.lib = import "${self}/lib" { - inherit (inputs.nixpkgs) lib; - inherit self; + flake.lib = { + isPrivateDomain = domain: domain |> lib.hasSuffix ".splitleaf.de"; + + listNixFilesRecursively = + dir: dir |> lib.filesystem.listFilesRecursive |> lib.filter (lib.hasSuffix ".nix"); + + listDirectoryNames = + path: path |> builtins.readDir |> lib.filterAttrs (_: type: type == "directory") |> lib.attrNames; + + genAttrs = f: names: lib.genAttrs names f; + + mkUnprotectedMessage = + name: "${name} should only be exposed on private networks; access control isn't yet configured"; + + relativePath = path: path |> toString |> lib.removePrefix "${self}/"; }; } diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index 29e074a..0000000 --- a/lib/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - lib, - self, -}: -{ - isPrivateDomain = domain: domain |> lib.hasSuffix ".splitleaf.de"; - - listNixFilesRecursively = - dir: dir |> lib.filesystem.listFilesRecursive |> lib.filter (lib.hasSuffix ".nix"); - - listDirectoryNames = - path: path |> builtins.readDir |> lib.filterAttrs (_: type: type == "directory") |> lib.attrNames; - - genAttrs = f: names: lib.genAttrs names f; - - mkUnprotectedMessage = - name: "${name} should only be exposed on private networks; access control isn't yet configured"; - - relativePath = path: path |> toString |> lib.removePrefix "${self}/"; -}