Skip to content

Commit e94f1d2

Browse files
committed
Merge branch 'main' into change-css
2 parents 18a4d0f + 2ebda36 commit e94f1d2

File tree

26 files changed

+501
-518
lines changed

26 files changed

+501
-518
lines changed

.cspell.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"safify",
2121
"supabase",
2222
"swiper",
23-
"lefthook"
23+
"lefthook",
24+
"stdenv",
25+
"rustc"
2426
],
2527
"dictionaries": [
2628
"softwareTerms",

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ start: start-all # build -> serve
3232
build: build-server build-web
3333
serve: serve-all # serve only. does not build.
3434
watch:
35-
(trap 'kill 0' SIGINT; make watch-web & make watch-server & wait)
35+
(trap 'kill 0' EXIT; make watch-web & make watch-server & wait)
3636

3737

3838
test: export DATABASE_URL=$(LOCAL_DB)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ GNU Make が導入されています。以下は、ユーザーが使うこと
2323

2424
- 以下をインストールします:
2525

26-
- Bun (js)
26+
- Bun
27+
- Node.js
2728
- GNU Make
2829
- nvm (optional)
2930
- lefthook

flake.lock

Lines changed: 15 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,61 @@
66
# unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
77

88
flake-utils.url = "github:numtide/flake-utils";
9-
fenix = {
10-
url = "github:nix-community/fenix/monthly";
9+
rust-overlay = {
10+
url = "github:oxalica/rust-overlay";
1111
inputs.nixpkgs.follows = "nixpkgs";
1212
};
1313
};
1414

15-
outputs = { nixpkgs, flake-utils, fenix, /* unstable, */ ... }:
16-
flake-utils.lib.eachDefaultSystem (system:
17-
let
18-
pkgs = nixpkgs.legacyPackages.${system};
19-
# unstable-pkgs = unstable.legacyPackages.${system};
20-
rust-toolchain = import ./nix/rust-toolchain.nix { inherit fenix system; };
15+
outputs = {
16+
nixpkgs,
17+
flake-utils,
18+
rust-overlay,
19+
/*
20+
unstable,
21+
*/
22+
...
23+
}:
24+
flake-utils.lib.eachDefaultSystem (system: let
25+
overlays = [(import rust-overlay)];
26+
pkgs = import nixpkgs {
27+
inherit system overlays;
28+
};
29+
# unstable-pkgs = unstable.legacyPackages.${system};
30+
rust-bin = pkgs.rust-bin.fromRustupToolchainFile ./scraper/rust-toolchain.toml;
2131

22-
common = {
23-
buildInputs = with pkgs; [
24-
gnumake
25-
bun
26-
biome
27-
lefthook
28-
dotenv-cli
29-
prisma
30-
prisma-engines
31-
];
32-
33-
shellHook = with pkgs; ''
34-
# requird by prisma
35-
export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine";
36-
export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node";
37-
export PRISMA_INTROSPECTION_ENGINE_BINARY="${prisma-engines}/bin/introspection-engine";
38-
export PRISMA_FMT_BINARY="${prisma-engines}/bin/prisma-fmt";
32+
common = {
33+
packages = with pkgs; [
34+
gnumake
35+
bun
36+
nodejs-slim
37+
biome
38+
lefthook
39+
dotenv-cli
40+
prisma
41+
stdenv.cc.cc.lib
42+
];
3943

40-
export LD_LIBRARY_PATH=${pkgs.stdenv.cc.cc.lib}/lib
41-
'';
44+
env = with pkgs; {
45+
# requird by prisma
46+
PRISMA_QUERY_ENGINE_BINARY = "${prisma-engines}/bin/query-engine";
47+
PRISMA_QUERY_ENGINE_LIBRARY = "${prisma-engines}/lib/libquery_engine.node";
48+
PRISMA_INTROSPECTION_ENGINE_BINARY = "${prisma-engines}/bin/introspection-engine";
49+
PRISMA_FMT_BINARY = "${prisma-engines}/bin/prisma-fmt";
4250
};
43-
in
44-
{
45-
devShells.default = pkgs.mkShell common;
46-
devShells.scraper = pkgs.mkShell {
47-
buildInputs = common.buildInputs ++ [
51+
};
52+
in {
53+
packages.scraper = pkgs.callPackage ./scraper {toolchain = rust-bin;};
54+
devShells.default = pkgs.mkShell common;
55+
devShells.scraper = pkgs.mkShell {
56+
inherit (common) env;
57+
packages =
58+
common.packages
59+
++ [
4860
pkgs.pkg-config
4961
pkgs.openssl
50-
rust-toolchain
62+
rust-bin
5163
];
52-
shellHook = common.shellHook;
53-
};
54-
});
64+
};
65+
});
5566
}
56-

nix/rust-toolchain.nix

Lines changed: 0 additions & 5 deletions
This file was deleted.

scraper/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scraper/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "course-mate-scraper"
2+
name = "coursemate-scraper"
33
version = "0.1.0"
44
edition = "2021"
55

scraper/default.nix

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
lib,
3+
stdenv,
4+
openssl,
5+
pkg-config,
6+
makeRustPlatform,
7+
toolchain,
8+
}: let
9+
rustPlatform = makeRustPlatform {
10+
cargo = toolchain;
11+
rustc = toolchain;
12+
};
13+
in
14+
rustPlatform.buildRustPackage {
15+
buildInputs = lib.lists.optional stdenv.isLinux openssl;
16+
nativeBuildInputs = lib.lists.optional stdenv.isLinux pkg-config;
17+
pname = "coursemate-scraper";
18+
version = "0.1.0";
19+
src = ./.;
20+
cargoLock.lockFile = ./Cargo.lock;
21+
}

scraper/rust-toolchain.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "1.82.0"
3-
targets = ["aarch64-apple-darwin", "x86_64-unknown-linux-gnu"]
2+
channel = "stable"
43
components = ["rustc", "cargo", "rustfmt", "clippy"]
4+
targets = []

0 commit comments

Comments
 (0)