Skip to content

Commit

Permalink
caddy: avoid use of builtins and prefer lib
Browse files Browse the repository at this point in the history
There is no `lib.hashString`, so keep using `builtins` for this one.
  • Loading branch information
vincentbernat committed Dec 24, 2024
1 parent 4642e27 commit e57d662
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkgs/by-name/ca/caddy/plugins.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
hash ? lib.fakeHash,
}:
let
pluginsSorted = builtins.sort builtins.lessThan plugins;
pluginsSorted = lib.sort lib.lessThan plugins;
pluginsList = lib.concatMapStrings (plugin: "${plugin}-") pluginsSorted;
pluginsHash = builtins.hashString "md5" pluginsList;
pluginsWithoutVersion = builtins.filter (p: !lib.hasInfix "@" p) pluginsSorted;
pluginsWithoutVersion = lib.filter (p: !lib.hasInfix "@" p) pluginsSorted;
in
assert lib.assertMsg (
builtins.length pluginsWithoutVersion == 0
) "All plugins should have a version (eg ${builtins.elemAt pluginsWithoutVersion 0}@x.y.z)!";
lib.length pluginsWithoutVersion == 0
) "All plugins should have a version (eg ${lib.elemAt pluginsWithoutVersion 0}@x.y.z)!";
caddy.overrideAttrs (
finalAttrs: prevAttrs: {
vendorHash = null;
Expand Down

0 comments on commit e57d662

Please sign in to comment.