|
5 | 5 | treefmt-nix.url = "github:numtide/treefmt-nix"; |
6 | 6 | treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; |
7 | 7 | }; |
8 | | - outputs = |
9 | | - { |
10 | | - self, |
11 | | - nixpkgs, |
12 | | - flake-utils, |
13 | | - treefmt-nix, |
14 | | - }: |
15 | | - let |
16 | | - prisma-factory = import ./prisma.nix; |
17 | | - in |
| 8 | + outputs = { |
| 9 | + self, |
| 10 | + nixpkgs, |
| 11 | + flake-utils, |
| 12 | + treefmt-nix, |
| 13 | + }: let |
| 14 | + prisma-factory = import ./prisma.nix; |
| 15 | + in |
18 | 16 | flake-utils.lib.eachDefaultSystem ( |
19 | | - system: |
20 | | - let |
| 17 | + system: let |
21 | 18 | pkgs = nixpkgs.legacyPackages.${system}; |
22 | 19 |
|
23 | 20 | yarn-v1 = pkgs.writeShellApplication { |
24 | 21 | name = "yarn-v1"; |
25 | 22 | checkPhase = ""; |
26 | | - runtimeInputs = [ pkgs.yarn ]; |
| 23 | + runtimeInputs = [pkgs.yarn]; |
27 | 24 | text = "yarn $@"; |
28 | 25 | }; |
29 | 26 | yarn-berry = pkgs.writeShellApplication { |
30 | 27 | name = "yarn-berry"; |
31 | 28 | checkPhase = ""; |
32 | | - runtimeInputs = [ pkgs.yarn-berry ]; |
| 29 | + runtimeInputs = [pkgs.yarn-berry]; |
33 | 30 | text = "yarn $@"; |
34 | 31 | }; |
35 | 32 | treefmt = treefmt-nix.lib.evalModule pkgs { |
36 | 33 | # nixfmt is nixfmt-rfc-style |
37 | 34 | programs.nixfmt.enable = true; |
38 | 35 | }; |
39 | | - in |
40 | | - { |
| 36 | + in { |
41 | 37 | formatter = treefmt.config.build.wrapper; |
42 | 38 | checks = |
43 | 39 | (pkgs.callPackages ./tests.nix { |
|
60 | 56 | }) |
61 | 57 | // { |
62 | 58 | format = treefmt.config.build.check self; |
63 | | - fetcher-assert-npm = |
64 | | - let |
65 | | - # force download debian for consistent hash across systems |
66 | | - binaryTargetBySystem = { |
67 | | - x86_64-linux = "debian"; |
68 | | - aarch64-linux = "debian"; |
69 | | - x86_64-darwin = "debian"; |
70 | | - aarch64-darwin = "debian"; |
71 | | - }; |
72 | | - prisma-legacy = prisma-factory { |
| 59 | + fetcher-assert-npm = let |
| 60 | + # force download debian for consistent hash across systems |
| 61 | + binaryTargetBySystem = { |
| 62 | + x86_64-linux = "debian"; |
| 63 | + aarch64-linux = "debian"; |
| 64 | + x86_64-darwin = "debian"; |
| 65 | + aarch64-darwin = "debian"; |
| 66 | + }; |
| 67 | + prisma-legacy = prisma-factory { |
| 68 | + inherit pkgs binaryTargetBySystem; |
| 69 | + hash = "sha256-R9PG286KQTbzF0r/PPcShUkMiYam2prRh/JICjmhCZA="; |
| 70 | + }; |
| 71 | + prisma-new = lockName: lockFile: |
| 72 | + prisma-factory { |
73 | 73 | inherit pkgs binaryTargetBySystem; |
74 | 74 | hash = "sha256-R9PG286KQTbzF0r/PPcShUkMiYam2prRh/JICjmhCZA="; |
| 75 | + ${lockName} = lockFile; |
75 | 76 | }; |
76 | | - prisma-new = |
77 | | - lockName: lockFile: |
78 | | - prisma-factory { |
79 | | - inherit pkgs binaryTargetBySystem; |
80 | | - hash = "sha256-R9PG286KQTbzF0r/PPcShUkMiYam2prRh/JICjmhCZA="; |
81 | | - ${lockName} = lockFile; |
82 | | - }; |
83 | | - in |
84 | | - assert |
85 | | - (prisma-legacy.fromNpmLock ./npm/package-lock.json).env |
86 | | - == (prisma-new "npmLock" ./npm/package-lock.json).env; |
87 | | - pkgs.hello; |
| 77 | + in |
| 78 | + assert (prisma-legacy.fromNpmLock ./npm/package-lock.json).env |
| 79 | + == (prisma-new "npmLock" ./npm/package-lock.json).env; |
| 80 | + pkgs.hello; |
| 81 | + prisma-next = |
| 82 | + (self.lib.prisma-factory { |
| 83 | + inherit pkgs; |
| 84 | + _commit = "next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513"; |
| 85 | + }).package; |
88 | 86 | }; |
89 | 87 | packages.default = |
90 | 88 | (prisma-factory { |
91 | 89 | inherit pkgs; |
92 | 90 | hash = "sha256-R9PG286KQTbzF0r/PPcShUkMiYam2prRh/JICjmhCZA="; |
93 | 91 | _commit = "6a3747c37ff169c90047725a05a6ef02e32ac97e"; |
94 | 92 | }).package; |
95 | | - devShells.default = |
96 | | - let |
97 | | - prisma = prisma-factory { |
98 | | - inherit pkgs; |
99 | | - hash = "sha256-R9PG286KQTbzF0r/PPcShUkMiYam2prRh/JICjmhCZA="; |
100 | | - _commit = "6a3747c37ff169c90047725a05a6ef02e32ac97e"; |
101 | | - }; |
102 | | - in |
| 93 | + devShells.default = let |
| 94 | + prisma = prisma-factory { |
| 95 | + inherit pkgs; |
| 96 | + hash = "sha256-R9PG286KQTbzF0r/PPcShUkMiYam2prRh/JICjmhCZA="; |
| 97 | + _commit = "6a3747c37ff169c90047725a05a6ef02e32ac97e"; |
| 98 | + }; |
| 99 | + in |
103 | 100 | pkgs.mkShell { |
104 | 101 | buildInputs = [ |
105 | 102 | pkgs.nodejs-18_x |
|
0 commit comments