|
10 | 10 | }; |
11 | 11 | }; |
12 | 12 |
|
13 | | - outputs = inputs@{ self, nixpkgs, utils, fenix}: |
14 | | - utils.lib.eachDefaultSystem (system: |
| 13 | + outputs = |
| 14 | + inputs@{ |
| 15 | + self, |
| 16 | + nixpkgs, |
| 17 | + utils, |
| 18 | + fenix, |
| 19 | + }: |
| 20 | + utils.lib.eachDefaultSystem ( |
| 21 | + system: |
15 | 22 | let |
16 | 23 | fenixToolchain = |
17 | 24 | let |
18 | 25 | toml = with builtins; (fromTOML (readFile ./rust-toolchain.toml)).toolchain; |
19 | 26 | in |
20 | | - (fenix.packages.${system}.fromToolchainName { |
21 | | - name = toml.channel; |
22 | | - sha256 = "sha256-r/8YBFuFa4hpwgE3FnME7nQA2Uc1uqj0eCE1NWmI1u0"; |
23 | | - })."completeToolchain"; |
| 27 | + (fenix.packages.${system}.fromToolchainName { |
| 28 | + name = toml.channel; |
| 29 | + sha256 = "sha256-r/8YBFuFa4hpwgE3FnME7nQA2Uc1uqj0eCE1NWmI1u0"; |
| 30 | + })."completeToolchain"; |
24 | 31 |
|
25 | 32 | pkgs = import nixpkgs { |
26 | 33 | inherit system; |
|
51 | 58 | C2RUST_USE_NIX = 1; |
52 | 59 | RUST_SRC_PATH = "${fenixToolchain}/lib/rustlib/src/rust/library"; |
53 | 60 | }; |
54 | | - in rec { |
| 61 | + in |
| 62 | + rec { |
55 | 63 | packages = { |
56 | | - default = rustPlatform.buildRustPackage (with pkgs; env // { |
57 | | - pname = "c2rust"; |
58 | | - version = "0.20.0"; |
59 | | - src = ./.; |
60 | | - doCheck = false; # Can use checkFlags to disable specific tests |
| 64 | + default = rustPlatform.buildRustPackage ( |
| 65 | + with pkgs; |
| 66 | + env |
| 67 | + // { |
| 68 | + pname = "c2rust"; |
| 69 | + version = "0.20.0"; |
| 70 | + src = ./.; |
| 71 | + doCheck = false; # Can use checkFlags to disable specific tests |
61 | 72 |
|
62 | | - patches = [ ./nix-tinycbor-cmake.patch ]; |
| 73 | + patches = [ ./nix-tinycbor-cmake.patch ]; |
63 | 74 |
|
64 | | - nativeBuildInputs = |
65 | | - with pkgs; [ |
| 75 | + nativeBuildInputs = with pkgs; [ |
66 | 76 | pkg-config |
67 | 77 | cmake |
68 | | - (python3.withPackages |
69 | | - (python-pkgs: |
70 | | - with python-pkgs; |
71 | | - [ "bencode-python3" |
72 | | - cbor |
73 | | - colorlog |
74 | | - mako |
75 | | - pip |
76 | | - plumbum |
77 | | - psutil |
78 | | - pygments |
79 | | - typing |
80 | | - "scan-build" |
81 | | - pyyaml |
82 | | - toml |
83 | | - ] |
84 | | - ) |
85 | | - ) |
| 78 | + uv |
| 79 | + (python3.withPackages ( |
| 80 | + python-pkgs: with python-pkgs; [ |
| 81 | + "bencode-python3" |
| 82 | + cbor |
| 83 | + colorlog |
| 84 | + mako |
| 85 | + pip |
| 86 | + plumbum |
| 87 | + psutil |
| 88 | + pygments |
| 89 | + typing |
| 90 | + "scan-build" |
| 91 | + pyyaml |
| 92 | + toml |
| 93 | + ] |
| 94 | + )) |
86 | 95 | myStdenv.cc |
87 | 96 | myLLVM.libclang |
88 | 97 | myLLVM.clang |
89 | 98 | myLLVM.llvm |
90 | 99 | myLLVM.libllvm |
91 | 100 | ]; |
92 | 101 |
|
93 | | - buildInputs = |
94 | | - with pkgs; [ |
| 102 | + buildInputs = with pkgs; [ |
95 | 103 | rustPlatform.bindgenHook |
96 | 104 | myStdenv.cc |
97 | 105 | myLLVM.libclang |
|
104 | 112 | fenixToolchain |
105 | 113 | ]; |
106 | 114 |
|
107 | | - cargoLock = { |
108 | | - lockFile = ./Cargo.lock; |
109 | | - }; |
110 | | - }); |
| 115 | + cargoLock = { |
| 116 | + lockFile = ./Cargo.lock; |
| 117 | + }; |
| 118 | + } |
| 119 | + ); |
111 | 120 | }; |
112 | 121 | defaultPackage = packages.default; |
113 | 122 |
|
114 | 123 | devShells = { |
115 | 124 | # Include a fixed version of clang in the development environment for testing. |
116 | | - default = pkgs.mkShell (with pkgs; env // { |
117 | | - strictDeps = true; |
118 | | - inputsFrom = [ packages.default ]; |
119 | | - buildInputs = [ ]; |
120 | | - }); |
| 125 | + default = pkgs.mkShell ( |
| 126 | + with pkgs; |
| 127 | + env |
| 128 | + // { |
| 129 | + strictDeps = true; |
| 130 | + inputsFrom = [ packages.default ]; |
| 131 | + buildInputs = [ ]; |
| 132 | + } |
| 133 | + ); |
121 | 134 | }; |
122 | 135 |
|
123 | 136 | devShell = devShells.default; |
124 | | - }); |
| 137 | + } |
| 138 | + ); |
125 | 139 | } |
0 commit comments