mirror of
https://github.com/lichess-org/lila.git
synced 2026-05-26 13:51:00 +00:00
Configure NixOS development environment for Lichess
* Read Node version from .node-version for single source of truth * Use dart-sass instead of embedded to avoid NixOS dynamic linking issues * Add Redis to dev dependencies * Set SASS_PATH to use system dart-sass via SASS_PATH env var * Update shellHook with LD_LIBRARY_PATH for NixOS compatibility
This commit is contained in:
Generated
+5
-5
@@ -2,12 +2,12 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1771848320,
|
||||
"narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=",
|
||||
"rev": "2fc6539b481e1d2569f25f8799236694180c0993",
|
||||
"revCount": 953160,
|
||||
"lastModified": 1775423009,
|
||||
"narHash": "sha256-vPKLpjhIVWdDrfiUM8atW6YkIggCEKdSAlJPzzhkQlw=",
|
||||
"rev": "68d8aa3d661f0e6bd5862291b5bb263b2a6595c9",
|
||||
"revCount": 975402,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.953160%2Brev-2fc6539b481e1d2569f25f8799236694180c0993/019c8e05-d2f6-7c7e-9ead-612154b18bfb/source.tar.gz"
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.975402%2Brev-68d8aa3d661f0e6bd5862291b5bb263b2a6595c9/019d657b-b3b7-7288-b3c0-42d420df206b/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
let
|
||||
javaVersion = 21;
|
||||
# Source of truth for Node version is .node-version
|
||||
nodeVersionFile = builtins.readFile ./.node-version;
|
||||
nodeMajorVersion = builtins.elemAt (inputs.nixpkgs.lib.strings.split "\\." (builtins.replaceStrings [ "v" ] [ "" ] nodeVersionFile)) 0;
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
@@ -37,8 +40,8 @@
|
||||
sbt = prev.sbt.override { jre = jdk; };
|
||||
scala = prev.scala_3.override { jre = jdk; };
|
||||
|
||||
nodejs_24 = prev.nodejs_24;
|
||||
pnpm = (prev.pnpm.override { nodejs = prev.nodejs_24; });
|
||||
nodejs = prev."nodejs_${nodeMajorVersion}";
|
||||
pnpm = (prev.pnpm.override { inherit nodejs; });
|
||||
|
||||
esbuild = prev.esbuild.overrideAttrs (previousAttrs: rec {
|
||||
version = "0.25.11";
|
||||
@@ -56,9 +59,10 @@
|
||||
{
|
||||
default = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [
|
||||
nodejs_24
|
||||
nodePackages.pnpm
|
||||
nodejs
|
||||
pnpm
|
||||
esbuild
|
||||
dart-sass
|
||||
oxlint
|
||||
oxfmt
|
||||
stylelint
|
||||
@@ -67,7 +71,16 @@
|
||||
scala
|
||||
sbt
|
||||
coursier
|
||||
|
||||
mongosh
|
||||
redis
|
||||
];
|
||||
# Required for NixOS to run prebuilt binaries from npm packages
|
||||
shellHook = ''
|
||||
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc ]}:$LD_LIBRARY_PATH
|
||||
# Use dart-sass instead of npm's sass-embedded
|
||||
export SASS_PATH=${pkgs.dart-sass}/bin/sass
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user