From 18e18ebc24dd4e9819a1e53b36e1bff07d7e30f6 Mon Sep 17 00:00:00 2001 From: chn Date: Fri, 5 Dec 2025 01:31:31 +0800 Subject: [PATCH] flake.lib: drop unused function --- flake/lib/default.nix | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/flake/lib/default.nix b/flake/lib/default.nix index 1c4e6902..d451f62d 100644 --- a/flake/lib/default.nix +++ b/flake/lib/default.nix @@ -20,24 +20,6 @@ lib: rec ) moduleList); - # from: https://github.com/NixOS/nix/issues/3759 - stripeTabs = text: - let - # Whether all lines start with a tab (or is empty) - shouldStripTab = lines: builtins.all (line: (line == "") || (lib.strings.hasPrefix " " line)) lines; - # Strip a leading tab from all lines - stripTab = lines: builtins.map (line: lib.strings.removePrefix " " line) lines; - # Strip tabs recursively until there are none - stripTabs = lines: if (shouldStripTab lines) then (stripTabs (stripTab lines)) else lines; - in - # Split into lines. Strip leading tabs. Concat back to string. - builtins.concatStringsSep "\n" (stripTabs (lib.strings.splitString "\n" text)); - - # find an element in a list, return the index - findIndex = e: list: - let findIndex_ = i: list: if (builtins.elemAt list i) == e then i else findIndex_ (i + 1) list; - in findIndex_ 0 list; - # return a list of path, including: # - all .nix file in the directory except for default.nix # - all directories containing a default.nix