| 18 Sep 2025 |
mmkaram | Does anyone remember the name of the formatter for nix files? | 08:42:00 |
Marie | nixfmt | 08:45:32 |
mmkaram | right, probably could've guessed that... thank you | 08:45:53 |
mmkaram | are there any examples of programs like mine that have been packaged in /pkgs/by-name | 08:58:48 |
Marie | anything which uses buildNpmPackage really | 09:02:07 |
Marie | it's also documented in the nixpkgs manual | 09:02:12 |
mmkaram | awesome! | 09:04:31 |
mmkaram | for the name should I keep it as @prisma/language-server because the contrib manual says to keep the name the same as upstream | 09:04:49 |
mmkaram | but also I know things with @ symbols aren't indexed on search.nixos.org | 09:05:03 |
Marie | uh that sounds wrong, where does it say that? | 09:05:34 |
Marie | prisma-language-server would be my suggestion | 09:05:51 |
mmkaram | https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#:~:text=It%20should%20be%20identical%20to%20the%20upstream%20package%20name. | 09:06:20 |
Marie | oh yeah thats not a hard requirement | 09:08:39 |
mmkaram | sweet | 09:08:58 |
mmkaram | would anyone here happen to have encountered this error before:
> npm error code ENOTCACHED
> npm error request to https://registry.npmjs.org/universal-user-agent failed: cache mode is 'only-if-cached' but no cached response is available.
> npm error A complete log of this run can be found in: /build/cache/_logs/2025-09-18T09_38_35_036Z-debug-0.log
| 09:39:19 |
mmkaram | here is my package.nix as it is:
{
lib,
buildNpmPackage,
fetchFromGitHub,
}:
buildNpmPackage (finalAttrs: {
pname = "prisma-language-server";
version = "6.16.2";
src = fetchFromGitHub {
owner = "prisma";
repo = "language-tools";
tag = "v${finalAttrs.version}";
hash = "sha256-x4lYhS8PJ5paFJDAXGtKv0kY01C/YWaJU640WlJT8Eo=";
};
npmDepsHash = "sha256-QMxu2AWGRQ2semp6BmOQbM7Pw/pS0mgx0P0hr60SjPs=";
# The prepack script runs the build script, which we'd rather do in the build phase.
npmPackFlags = [ "--ignore-scripts" ];
makeCacheWritable = true;
NODE_OPTIONS = "--openssl-legacy-provider";
meta = {
description = "";
homepage = "https://github.com/prisma/language-tools#readme";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ mmkaram ];
};
})
| 09:39:35 |
Marie | yes their lockfile is broken | 09:41:30 |
Marie | thats an issue which has been known for years now and npm doesn't consider it a bug | 09:41:51 |
mmkaram | exciting. | 09:42:07 |
mmkaram | would maybe going to an older revision help? | 09:42:12 |
mmkaram | where the lockfile isn't broken | 09:42:16 |
Marie | probably not | 09:42:25 |
Marie | you need to clone the repo, delete package-lock.json and run npm install --package-lock-only | 09:42:56 |
Marie | and use that one in your nix package | 09:43:02 |
mmkaram | okay will get on it | 09:43:14 |
Marie | there should be examples of this in nixpkgs already | 09:43:20 |
mmkaram | examples of what? using a different lockfile? | 09:43:38 |
Marie | yes, providing your own lockfile | 09:43:47 |
mmkaram | ah okay, would this parameter help at all: fetchNpmDeps? | 09:44:25 |
Marie | https://github.com/NixOS/nixpkgs/blob/10a275e22017a6c9bf3a38dbdcf504daa36f51c7/pkgs/by-name/in/intelephense/package.nix#L19 | 09:44:37 |