|
1 | 1 | {
|
2 |
| - description = "purescript-cardano-types"; |
| 2 | + description = "purescript-cardano-plutus-data-schema"; |
3 | 3 |
|
4 | 4 | # Allow IFD in `nix flake check`.
|
5 | 5 | nixConfig.allow-import-from-derivation = "true";
|
6 | 6 |
|
7 | 7 | nixConfig = {
|
8 | 8 | extra-substituters = [ "https://plutonomicon.cachix.org" ];
|
9 | 9 | extra-trusted-public-keys = [ "plutonomicon.cachix.org-1:evUxtNULjCjOipxwAnYhNFeF/lyYU1FeNGaVAnm+QQw=" ];
|
10 |
| - bash-prompt = "\\[\\e[0m\\][\\[\\e[0;2m\\]nix-develop \\[\\e[0;1m\\]ps-cardano-types@\\[\\033[33m\\]$(git rev-parse --abbrev-ref HEAD) \\[\\e[0;32m\\]\\w\\[\\e[0m\\]]\\[\\e[0m\\]$ \\[\\e[0m\\]"; |
| 10 | + bash-prompt = "\\[\\e[0m\\][\\[\\e[0;2m\\]nix-develop \\[\\e[0;1m\\]ps-cpds@\\[\\033[33m\\]$(git rev-parse --abbrev-ref HEAD) \\[\\e[0;32m\\]\\w\\[\\e[0m\\]]\\[\\e[0m\\]$ \\[\\e[0m\\]"; |
11 | 11 | };
|
12 | 12 |
|
13 | 13 | inputs = {
|
|
81 | 81 | '';
|
82 | 82 | };
|
83 | 83 |
|
84 |
| - nodejs = pkgs.nodejs-18_x; |
85 |
| - |
86 |
| - src = ./.; |
87 |
| - |
88 |
| - mkNodeEnv = { withDevDeps ? true }: import |
89 |
| - (pkgs.runCommand "node-packages" |
90 |
| - { |
91 |
| - buildInputs = [ pkgs.nodePackages.node2nix ]; |
92 |
| - } '' |
93 |
| - mkdir $out |
94 |
| - cd $out |
95 |
| - cp ${src}/package-lock.json ./package-lock.json |
96 |
| - cp ${src}/package.json ./package.json |
97 |
| - node2nix ${pkgs.lib.optionalString withDevDeps "--development" } \ |
98 |
| - --lock ./package-lock.json -i ./package.json |
99 |
| - '') |
100 |
| - { inherit pkgs nodejs system; }; |
101 |
| - |
102 |
| - mkNodeModules = { withDevDeps ? true }: |
103 |
| - let |
104 |
| - nodeEnv = mkNodeEnv { inherit withDevDeps; }; |
105 |
| - modules = pkgs.callPackage |
106 |
| - (_: |
107 |
| - nodeEnv // { |
108 |
| - shell = nodeEnv.shell.override { |
109 |
| - # see https://github.com/svanderburg/node2nix/issues/198 |
110 |
| - buildInputs = [ pkgs.nodePackages.node-gyp-build ]; |
111 |
| - }; |
112 |
| - }); |
113 |
| - in |
114 |
| - (modules { }).shell.nodeDependencies; |
115 |
| - |
116 |
| - nodeModules = mkNodeModules { }; |
117 |
| - |
118 | 84 | # Compiles your Purescript project and copies the `output` directory into the
|
119 | 85 | # Nix store. Also copies the local sources to be made available later as `purs`
|
120 | 86 | # does not include any external files to its `output` (if we attempted to refer
|
|
145 | 111 | ];
|
146 | 112 | unpackPhase = ''
|
147 | 113 | export HOME="$TMP"
|
148 |
| -
|
149 |
| - # handle NodeJS deps |
150 |
| - export NODE_PATH="${nodeModules}/lib/node_modules" |
151 |
| - ln -sfn $NODE_PATH node_modules |
152 |
| - export PATH="${nodeModules}/bin:$PATH" |
153 |
| -
|
154 | 114 | # copy the dependency build artifacts and sources
|
155 | 115 | # preserve the modification date so that we don't rebuild them
|
156 | 116 | mkdir -p output .spago
|
|
206 | 166 | # Copy the purescript project files
|
207 | 167 | cp -r ${builtProject}/* .
|
208 | 168 |
|
209 |
| - # Handle nodejs dependencies |
210 |
| - export NODE_PATH="${nodeModules}/lib/node_modules" |
211 |
| - ln -sfn $NODE_PATH node_modules |
212 |
| - export PATH="${nodeModules}/bin:$PATH" |
213 |
| -
|
214 | 169 | # The tests may depend on sources
|
215 | 170 | cp -r $src/* .
|
216 | 171 |
|
|
225 | 180 | {
|
226 | 181 | devShells = {
|
227 | 182 | default = pkgs.mkShell {
|
228 |
| - shellHook = '' |
229 |
| - export NODE_PATH="${nodeModules}/lib/node_modules" |
230 |
| - ln -sfn $NODE_PATH node_modules |
231 |
| - export PATH="${nodeModules}/bin:$PATH" |
232 |
| - export NPM_CONFIG_PACKAGE_LOCK_ONLY=true |
233 |
| - ''; |
234 | 183 | buildInputs = with pkgs; [
|
235 | 184 | nixpkgs-fmt
|
236 | 185 | easy-ps.purs
|
|
0 commit comments