|
45 | 45 | ]) path != null; |
46 | 46 | filter = path: type: (filter' path type) || (craneLib.filterCargoSources path type); |
47 | 47 | src = lib.cleanSourceWith { |
48 | | - src = ./.; |
| 48 | + src = ./.; |
49 | 49 | inherit filter; |
50 | 50 | name = "source"; |
51 | 51 | }; |
|
65 | 65 | ++ lib.optionals pkgs.stdenv.isDarwin ( |
66 | 66 | with pkgs; |
67 | 67 | [ |
68 | | - # additional dependencies on Darwin systems |
69 | | - CoreFoundation |
70 | | - libresolv |
71 | | - Security |
| 68 | + # additional dependencies on Darwin systems |
| 69 | + CoreFoundation |
| 70 | + libresolv |
| 71 | + Security |
72 | 72 | ] |
73 | 73 | ); |
74 | 74 | # Software required for project build |
|
79 | 79 | # Tools required for checks |
80 | 80 | nativeCheckInputs = with pkgs; [ git ]; |
81 | 81 |
|
82 | | - # Additional environment variables can be set directly |
83 | | - # MY_CUSTOM_VAR = "some value"; |
| 82 | + # Additional environment variables |
| 83 | + # This one overrides build profile (default is 'release') |
| 84 | + CARGO_PROFILE = "dev"; |
| 85 | + |
84 | 86 | }; |
85 | 87 |
|
86 | 88 | # Build dependencies only, so we will be able to reuse them further |
|
100 | 102 | clippy = craneLib.cargoClippy ( |
101 | 103 | common |
102 | 104 | // { |
103 | | - inherit cargoArtifacts; |
104 | | - cargoClippyExtraArgs = "--all-targets -- --deny warnings"; |
| 105 | + inherit cargoArtifacts; |
| 106 | + cargoClippyExtraArgs = "--all-targets -- --deny warnings"; |
105 | 107 | } |
106 | 108 | ); |
107 | 109 |
|
|
128 | 130 | nextest = craneLib.cargoNextest ( |
129 | 131 | common |
130 | 132 | // { |
131 | | - inherit cargoArtifacts; |
132 | | - partitions = 1; |
133 | | - partitionType = "count"; |
134 | | - cargoNextestPartitionsExtraArgs = "--no-tests=pass"; |
| 133 | + inherit cargoArtifacts; |
| 134 | + partitions = 1; |
| 135 | + partitionType = "count"; |
| 136 | + cargoNextestPartitionsExtraArgs = "--no-tests=pass"; |
135 | 137 | } |
136 | 138 | ); |
137 | 139 | }; |
|
142 | 144 | // { |
143 | 145 | inherit cargoArtifacts; |
144 | 146 | doCheck = false; |
145 | | - CARGO_PROFILE = "dev"; |
146 | 147 | } |
147 | 148 | ); |
148 | 149 | onefetch = craneLib.buildPackage ( |
149 | 150 | common |
150 | 151 | // { |
| 152 | + CARGO_PROFILE = "release"; |
151 | 153 | inherit cargoArtifacts; |
152 | 154 | doCheck = false; |
153 | 155 | } |
154 | 156 | ); |
155 | 157 | default = onefetch-debug; |
156 | 158 | }; |
157 | 159 |
|
158 | | - apps.default = flake-utils.lib.mkApp { drv = build; }; |
| 160 | + apps.default = flake-utils.lib.mkApp { drv = (build // { CARGO_PROFILE = "release"; }); }; |
159 | 161 |
|
160 | 162 | devShells.default = craneLib.devShell { |
161 | 163 | # Inherit inputs from checks. |
|
0 commit comments