nixos-configs/lib/pkgs.nix
matt1432 f06b0d9c5b
All checks were successful
Discord / discord commits (push) Has been skipped
refactor: restructure my custom nix functions
2024-08-07 14:47:32 -04:00

24 lines
609 B
Nix

pkgs: mkVersion: {
buildPlugin = pname: src:
pkgs.vimUtils.buildVimPlugin {
inherit pname src;
version = mkVersion src;
};
buildNodeModules = dir: npmDepsHash: let
pkg = pkgs.callPackage ({buildNpmPackage, ...}: let
inherit (builtins) readFile fromJSON;
packageJSON = fromJSON (readFile (dir + /package.json));
in
buildNpmPackage {
pname = packageJSON.name;
inherit (packageJSON) version;
src = dir;
inherit npmDepsHash;
dontNpmBuild = true;
}) {};
in "${pkg}/lib/node_modules/${pkg.pname}/node_modules";
}