2024-08-07 14:47:32 -04:00
|
|
|
{
|
|
|
|
inputs ? {},
|
|
|
|
pkgs ? {},
|
2024-09-24 16:12:57 -04:00
|
|
|
self ? {},
|
2024-08-07 14:47:32 -04:00
|
|
|
}: let
|
|
|
|
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
|
|
|
|
|
|
|
|
lib = import "${builtins.fetchTarball {
|
|
|
|
url = "https://github.com/NixOS/nixpkgs/archive/${lock.nodes.nixpkgs.locked.rev}.tar.gz";
|
|
|
|
sha256 = lock.nodes.nixpkgs.locked.narHash;
|
|
|
|
}}/lib";
|
|
|
|
|
2024-09-24 16:12:57 -04:00
|
|
|
inherit (lib) concatStringsSep optionalAttrs stringToCharacters substring tail toUpper;
|
2024-08-07 14:47:32 -04:00
|
|
|
|
|
|
|
mkVersion = src: "0.0.0+" + src.shortRev;
|
2024-09-24 16:12:57 -04:00
|
|
|
capitalise = str: (toUpper (substring 0 1 str) + (concatStringsSep "" (tail (stringToCharacters str))));
|
2024-08-07 14:47:32 -04:00
|
|
|
in
|
2024-09-24 16:12:57 -04:00
|
|
|
{inherit lib mkVersion capitalise;}
|
2024-08-07 14:47:32 -04:00
|
|
|
// optionalAttrs (inputs != {}) (import ./flake-lib.nix inputs)
|
2024-09-25 15:34:56 -04:00
|
|
|
// optionalAttrs (pkgs != {}) (import ./pkgs.nix {inherit pkgs mkVersion capitalise self;})
|