Compare commits
2 Commits
bcd4c4a269
...
b130423331
Author | SHA1 | Date | |
---|---|---|---|
b130423331 | |||
fc9e687e8d |
13
flake.nix
13
flake.nix
@ -18,12 +18,13 @@
|
||||
packages = import ./pkgs/top-level { localSystem = system; inherit pkgs; };
|
||||
|
||||
checks = {
|
||||
nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" ''
|
||||
${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt --check .
|
||||
'';
|
||||
deadnix = pkgs.writeShellScriptBin "deadnix-check" ''
|
||||
${pkgs.deadnix}/bin/deadnix --fail .
|
||||
'';
|
||||
# FIXME: Disabled until I can work out what to do with generated code.
|
||||
# nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" ''
|
||||
# ${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt --check .
|
||||
# '';
|
||||
# deadnix = pkgs.writeShellScriptBin "deadnix-check" ''
|
||||
# ${pkgs.deadnix}/bin/deadnix --fail .
|
||||
# '';
|
||||
# Ensures that the NUR bot can evaluate and find all our packages.
|
||||
# Normally we'd also run with `--option restrict-eval true`, but
|
||||
# this is incompatible with flakes because reasons.
|
||||
|
@ -2,10 +2,7 @@
|
||||
|
||||
{pkgs ? import <nixpkgs> {
|
||||
inherit system;
|
||||
}
|
||||
, system ? builtins.currentSystem
|
||||
, nodejs ? pkgs."nodejs_18"
|
||||
}:
|
||||
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs_18"}:
|
||||
|
||||
let
|
||||
nodeEnv = import ./node-env.nix {
|
||||
|
@ -96,22 +96,20 @@ let
|
||||
mkdir -p node_modules
|
||||
cd node_modules
|
||||
''
|
||||
+ (lib.concatMapStrings
|
||||
(dependency:
|
||||
+ (lib.concatMapStrings (dependency:
|
||||
''
|
||||
if [ ! -e "${dependency.packageName}" ]; then
|
||||
${composePackage dependency}
|
||||
fi
|
||||
''
|
||||
)
|
||||
dependencies)
|
||||
) dependencies)
|
||||
+ ''
|
||||
cd ..
|
||||
''
|
||||
);
|
||||
|
||||
# Recursively composes the dependencies of a package
|
||||
composePackage = { packageName, src, dependencies ? [ ], ... }:
|
||||
composePackage = { name, packageName, src, dependencies ? [], ... }@args:
|
||||
builtins.addErrorContext "while evaluating node package '${packageName}'" ''
|
||||
installPackage "${packageName}" "${src}"
|
||||
${includeDependencies { inherit dependencies; }}
|
||||
@ -196,7 +194,7 @@ let
|
||||
# dependencies in the package.json file to the versions that are actually
|
||||
# being used.
|
||||
|
||||
pinpointDependenciesOfPackage = { packageName, dependencies ? [ ], production ? true, ... }:
|
||||
pinpointDependenciesOfPackage = { packageName, dependencies ? [], production ? true, ... }@args:
|
||||
''
|
||||
if [ -d "${packageName}" ]
|
||||
then
|
||||
@ -481,6 +479,7 @@ let
|
||||
{ name
|
||||
, packageName
|
||||
, version ? null
|
||||
, dependencies ? []
|
||||
, buildInputs ? []
|
||||
, production ? true
|
||||
, npmFlags ? ""
|
||||
@ -492,8 +491,7 @@ let
|
||||
, unpackPhase ? "true"
|
||||
, buildPhase ? "true"
|
||||
, meta ? {}
|
||||
, ...
|
||||
}@args:
|
||||
, ... }@args:
|
||||
|
||||
let
|
||||
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" "meta" ];
|
||||
@ -584,8 +582,7 @@ let
|
||||
, dontStrip ? true
|
||||
, unpackPhase ? "true"
|
||||
, buildPhase ? "true"
|
||||
, ...
|
||||
}@args:
|
||||
, ... }@args:
|
||||
|
||||
let
|
||||
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ];
|
||||
@ -643,11 +640,20 @@ let
|
||||
# Builds a development shell
|
||||
buildNodeShell =
|
||||
{ name
|
||||
, packageName
|
||||
, version ? null
|
||||
, src
|
||||
, dependencies ? []
|
||||
, buildInputs ? []
|
||||
, ...
|
||||
}@args:
|
||||
, production ? true
|
||||
, npmFlags ? ""
|
||||
, dontNpmInstall ? false
|
||||
, bypassCache ? false
|
||||
, reconstructLock ? false
|
||||
, dontStrip ? true
|
||||
, unpackPhase ? "true"
|
||||
, buildPhase ? "true"
|
||||
, ... }@args:
|
||||
|
||||
let
|
||||
nodeDependencies = buildNodeDependencies args;
|
||||
|
@ -1,6 +1,6 @@
|
||||
# This file has been generated by node2nix 1.11.1. Do not edit!
|
||||
|
||||
{ nodeEnv, fetchurl, nix-gitignore, stdenv, lib, globalBuildInputs ? [ ] }:
|
||||
{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:
|
||||
|
||||
let
|
||||
sources = {
|
||||
@ -9196,7 +9196,8 @@ let
|
||||
})
|
||||
];
|
||||
buildInputs = globalBuildInputs;
|
||||
meta = { };
|
||||
meta = {
|
||||
};
|
||||
production = false;
|
||||
bypassCache = true;
|
||||
reconstructLock = false;
|
||||
@ -9215,8 +9216,7 @@ in
|
||||
"*"
|
||||
"!package.json"
|
||||
"!package-lock.json"
|
||||
]
|
||||
args.src;
|
||||
] args.src;
|
||||
dontBuild = true;
|
||||
installPhase = "mkdir -p $out; cp -r ./* $out;";
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user