main
1{
2 inputs = {
3 nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4 flake-parts = {
5 url = "github:hercules-ci/flake-parts";
6 inputs.nixpkgs-lib.follows = "nixpkgs";
7 };
8 devshell = {
9 url = "github:numtide/devshell";
10 inputs.nixpkgs.follows = "nixpkgs";
11 };
12 treefmt-nix = {
13 url = "github:numtide/treefmt-nix";
14 inputs.nixpkgs.follows = "nixpkgs";
15 };
16 flake-compat.url = "github:NixOS/flake-compat";
17 };
18
19 outputs = inputs:
20 inputs.flake-parts.lib.mkFlake {inherit inputs;} {
21 imports = [
22 inputs.devshell.flakeModule
23 inputs.treefmt-nix.flakeModule
24 ];
25
26 systems = [
27 "x86_64-linux"
28 "aarch64-linux"
29 "x86_64-darwin"
30 "aarch64-darwin"
31 ];
32
33 perSystem = {pkgs, ...}: {
34 devshells.default = {
35 motd = "";
36 packages = with pkgs; [
37 # Dependencies
38 nodejs_26 # For `Temporal`
39
40 # Dev Tools
41 typescript-language-server
42 astro-language-server
43 vscode-css-languageserver
44 vscode-json-languageserver
45 biome
46 tinymist # Typst LSP
47 ];
48
49 env = [
50 {
51 # For Sharp in Deno
52 name = "LD_LIBRARY_PATH";
53 prefix = "${pkgs.stdenv.cc.cc.lib}/lib";
54 }
55 ];
56 };
57
58 treefmt = {
59 programs.alejandra.enable = true;
60 programs.biome = {
61 enable = true;
62 includes = [
63 "*.js"
64 "*.ts"
65 "*.mjs"
66 "*.mts"
67 "*.jsx"
68 "*.tsx"
69 "*.d.ts"
70 "*.json"
71 "*.jsonc"
72 "*.css"
73 "*.scss" # Biome will land SCSS support in 2.6
74 "*.astro"
75 ];
76 validate.enable = false;
77 settings =
78 builtins.fromJSON (builtins.readFile ./biome.json)
79 // {
80 vcs.enabled = false; # Nix flake already has VCS integration
81 };
82 };
83 programs.typstyle = {
84 enable = true;
85 lineWidth = 80;
86 };
87 };
88 };
89 };
90}