workspace: use direnv instead of corepack

This commit is contained in:
undefined committed 2025-12-29 10:32:01 +08:00
1 parent 0ce8d5aa8d
commit 4dda4feb2c
6 files changed
+77 -25

No files matched your search

+1
View File
@@ -0,0 +1 @@
use flake
+1 -2
View File
@@ -21,8 +21,6 @@ jobs:
with:
submodules: recursive
fetch-depth: 2
- name: Setup Corepack
run: corepack enable
- name: Set up Node
uses: actions/setup-node@v4
with:
@@ -49,6 +47,7 @@ jobs:
run: |
git config --global user.name undefined
git config --global user.email i@undefined.moe
yarn set version stable
yarn
yarn dedupe
env:
+1
View File
@@ -16,6 +16,7 @@ benchmark.json
globalConfig.json
*.out
.clinic/
.direnv/
.yarn/cache
.yarn/build-state.yml
.yarn/unplugged
Generated
+37 -3
View File
@@ -1,12 +1,30 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1739446958,
"narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=",
"lastModified": 1766902085,
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2ff53fe64443980e139eaa286017f53f88336dd0",
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
"type": "github"
},
"original": {
@@ -18,8 +36,24 @@
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
+36 -18
View File
@@ -1,26 +1,44 @@
{
description = "Hydro development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
composeConfig = {
version = "0.5";
processes = {
hydro = {
command = "${pkgs.nodejs}/bin/node node_modules/.bin/hydrooj --debug --port=2333";
is_interactive = true;
};
go-judge = {
command = "${pkgs.go-judge}/bin/go-judge";
};
webpack = {
command = "${pkgs.yarn-berry}/bin/yarn build:ui:dev";
};
};
};
in
{
apps.default = {
type = "app";
program = "${pkgs.writeShellScript "compose.sh" ''
${pkgs.process-compose}/bin/process-compose -f ${pkgs.writeText "process-compose.yml" (builtins.toJSON composeConfig)}
''}";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
packages.${system}.default = pkgs.hello;
devShells.${system}.default = pkgs.mkShell {
buildInputs = [
pkgs.nodejs
pkgs.yarn-berry
pkgs.pm2
pkgs.git
pkgs.gcc
pkgs.go-judge
pkgs.mongodb-ce
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
yarn-berry
gcc
go-judge
];
};
};
});
}
+1 -2
View File
@@ -65,6 +65,5 @@
"resolutions": {
"mongodb": "^7.0.0",
"@types/express-serve-static-core": "patch:@types/express-serve-static-core@npm%3A4.19.6#~/.yarn/patches/@types-express-serve-static-core-npm-4.19.6-cc0017aaf4.patch"
},
"packageManager": "yarn@4.10.3"
}
}