feat(v1): add nodejs package prettier

This commit is contained in:
DavHau 2023-03-26 17:55:21 +08:00
parent 6efc60882a
commit 18d8a016fa
3 changed files with 40 additions and 2 deletions

View File

@ -10,7 +10,8 @@
loadOverrides = dir:
l.genAttrs (config.dlib.dirNames dir) (name:
import (dir + "/${name}") {
inherit (config) lib pkgs;
inherit pkgs;
inherit (config) lib;
satisfiesSemver = constraint: pkg:
config.utils.satisfiesSemver pkg.version constraint;
});

View File

@ -8,7 +8,7 @@
python $installDeps
echo "Symlinking transitive executables to $nodeModules/.bin"
for dep in ${lib.toString nodeDeps}; do
for dep in ${toString nodeDeps}; do
binDir=$dep/lib/node_modules/.bin
if [ -e $binDir ]; then
for bin in $(ls $binDir/); do\

View File

@ -0,0 +1,37 @@
{
lib,
config,
drv-parts,
...
}: let
l = lib // builtins;
in {
imports = [
drv-parts.modules.drv-parts.mkDerivation
../../drv-parts/dream2nix-legacy
];
legacy = {
subsystem = "nodejs";
translator = "yarn-lock";
builder = "granular-nodejs";
subsystemInfo = {
nodejs = "16";
noDev = false;
};
source = config.deps.fetchFromGitHub {
owner = "prettier";
repo = "prettier";
rev = config.version;
sha256 = "sha256-gHFzUjTHsEcxTJtFflqSOCthKW4Wa+ypuTeGxodmh0o=";
};
};
deps = {nixpkgs, ...}: {
inherit (nixpkgs) fetchFromGitHub;
inherit (nixpkgs) stdenv;
};
name = l.mkForce "prettier";
version = l.mkForce "2.8.7";
}