-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathflake.nix
More file actions
65 lines (57 loc) · 1.56 KB
/
Copy pathflake.nix
File metadata and controls
65 lines (57 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
description = "The AI-era curl: fetch, discover, extract. One command.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
bun2nix = {
url = "github:nix-community/bun2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs, bun2nix, ... }:
let
inherit (nixpkgs) lib;
forAllSystems = lib.genAttrs (import ./nix/systems.nix);
packages = forAllSystems (
system:
let
ax = nixpkgs.legacyPackages.${system}.callPackage ./package.nix {
bun2nix = bun2nix.packages.${system}.default;
};
in
{
inherit ax;
default = ax;
}
);
in
{
inherit packages;
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-tree);
checks = forAllSystems (system: {
build = packages.${system}.ax;
});
devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShellNoCC {
packages = [
pkgs.bun
bun2nix.packages.${system}.default
];
shellHook = ''
# Install dependencies only if node_modules is missing or older
# than the lockfile
if [ ! -d node_modules ] || [ bun.lock -nt node_modules ]; then
echo "📦 Installing dependencies..."
bun install --frozen-lockfile
fi
'';
};
}
);
};
}