diff --git a/escape.nix b/escape.nix index 4276066..4f4af1b 100644 --- a/escape.nix +++ b/escape.nix @@ -1,8 +1,6 @@ # Taken from https://github.com/nrabulinski/cursed-nix. Huge thanks! -let - lib = (import {}).lib; - +lib: let startMarker = "__START__"; endMarker = "__END__"; diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..7f70e20 --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "lib": { + "locked": { + "lastModified": 1708821942, + "narHash": "sha256-jd+E1SD59qty65pwqad2mftzkT6vW5nNFWVuvayh4Zw=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "479831ed8b3c9c7b80533999f880c7d0bf6a491b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "lib": "lib" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index fe2ac00..44bae5c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,14 +1,16 @@ { description = "Write composeable HTML with Nix!"; - outputs = { self }: let + inputs.lib.url = "github:nix-community/nixpkgs.lib"; + + outputs = { self, lib }: let first = n: builtins.substring 0 n; dropFirst = n: string: builtins.substring n (builtins.stringLength string - n) string; last = n: string: builtins.substring (builtins.stringLength string - n) n string; dropLast = n: string: builtins.substring 0 (builtins.stringLength string - n) string; - escapix = import ./escape.nix; + escapix = import ./escape.nix lib.lib; inherit (escapix) escape; attrsetToHtmlAttrs = attrs: