Skip to content

Instantly share code, notes, and snippets.

@c0deaddict
Created August 20, 2019 09:16
Show Gist options
  • Save c0deaddict/b2a6dc00a7a67b9d25ab80f0f1de2244 to your computer and use it in GitHub Desktop.
Save c0deaddict/b2a6dc00a7a67b9d25ab80f0f1de2244 to your computer and use it in GitHub Desktop.
NixOS custom nodePackages
{ pkgs, nodejs, stdenv }:
let
nodePackages = import ./composition.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
};
in
nodePackages
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nodePackages.node2nix
set -eu -o pipefail
rm -f node-env.nix
node2nix --nodejs-10 -i packages.json -o packages.nix -c composition.nix
home.packages = let
myNodePackages = import ../../custom/node-packages {
inherit pkgs nodejs stdenv;
};
in [
nodejs
(with myNodePackages; [
eslint
typescript-language-server
...
])
];
[
"eslint"
, "eslint-config-prettier"
, "eslint-plugin-prettier"
, "javascript-typescript-langserver"
, "typescript"
, "typescript-language-server"
, "prettier"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment