Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use flake
use flake ./dev
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
steps:
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
- run: nix flake check
- run: nix flake check ./dev
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"[nix]": {
"editor.defaultFormatter": "brettm12345.nixfmt-vscode"
"editor.defaultFormatter": "VanCoding.vscode-treefmt-nix"
}
}
80 changes: 80 additions & 0 deletions dev/checks.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
perSystem =
{ pkgs, ... }:
let
prisma-factory = import ../prisma.nix;
yarn-v1 = pkgs.writeShellApplication {
name = "yarn-v1";
checkPhase = "";
runtimeInputs = [ pkgs.yarn ];
text = "yarn $@";
};
yarn-berry = pkgs.writeShellApplication {
name = "yarn-berry";
checkPhase = "";
runtimeInputs = [ pkgs.yarn-berry ];
text = "yarn $@";
};
in
{
checks =
(pkgs.callPackages ../tests.nix {
fetcherMode = "new";
inherit
pkgs
prisma-factory
yarn-v1
yarn-berry
;
})
// (pkgs.callPackages ../tests.nix {
fetcherMode = "legacy";
inherit
pkgs
prisma-factory
yarn-v1
yarn-berry
;
})
// {
fetcher-assert-npm =
let
# force download debian for consistent hash across systems
binaryTargetBySystem = {
x86_64-linux = "debian";
aarch64-linux = "debian";
x86_64-darwin = "debian";
aarch64-darwin = "debian";
};
prisma-legacy = prisma-factory {
inherit pkgs binaryTargetBySystem;
hash = "sha256-R9PG286KQTbzF0r/PPcShUkMiYam2prRh/JICjmhCZA=";
};
prisma-new =
lockName: lockFile:
prisma-factory {
inherit pkgs binaryTargetBySystem;
hash = "sha256-R9PG286KQTbzF0r/PPcShUkMiYam2prRh/JICjmhCZA=";
${lockName} = lockFile;
};
in
assert
(prisma-legacy.fromNpmLock ../npm/package-lock.json).env
== (prisma-new "npmLock" ../npm/package-lock.json).env;
pkgs.hello;
prisma-next =
(prisma-factory {
pkgs = pkgs;
versionString = "6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513";
hash =
{
x86_64-linux = "sha256-JWX+N/mmp9uJLcv4XFbQ3yg34fFf2BLIUpOLrrfTjEM=";
x86_64-darwin = "sha256-WNwFOoeDOebbfAh4y/NvZCyE9otaJdg2hHb4ifEFD+Y=";
aarch64-linux = "sha256-f9FuPZaGx0FwKo4pA9f8g82MTcAzYLwWslxjb7oqk6E=";
aarch64-darwin = "sha256-NMI+JcP3epBO3V37D19TDgzivMnPekgrYqUrXB6qNV0=";
}
.${pkgs.system};
}).package;
};
};
}
82 changes: 82 additions & 0 deletions dev/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions dev/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
imports = [
./treefmt.nix
./shell.nix
./checks.nix
];
};
}
15 changes: 15 additions & 0 deletions dev/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
perSystem =
{ pkgs, config, ... }:
{
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.nodejs_24
pkgs.pnpm
pkgs.bun
pkgs.stdenv.cc.cc.lib
config.treefmt.build.wrapper
];
};
};
}
7 changes: 7 additions & 0 deletions dev/treefmt.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ inputs, ... }:
{
imports = [ inputs.treefmt-nix.flakeModule ];
perSystem.treefmt = {
programs.nixfmt.enable = true;
};
}
77 changes: 1 addition & 76 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading