Skip to content

Commit 7ec42a3

Browse files
authored
Add missing uv dependency to Nix flake (#1539)
2 parents 986906e + b89fb50 commit 7ec42a3

File tree

1 file changed

+59
-45
lines changed

1 file changed

+59
-45
lines changed

flake.nix

Lines changed: 59 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,24 @@
1010
};
1111
};
1212

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:
1522
let
1623
fenixToolchain =
1724
let
1825
toml = with builtins; (fromTOML (readFile ./rust-toolchain.toml)).toolchain;
1926
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";
2431

2532
pkgs = import nixpkgs {
2633
inherit system;
@@ -51,47 +58,48 @@
5158
C2RUST_USE_NIX = 1;
5259
RUST_SRC_PATH = "${fenixToolchain}/lib/rustlib/src/rust/library";
5360
};
54-
in rec {
61+
in
62+
rec {
5563
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
6172

62-
patches = [ ./nix-tinycbor-cmake.patch ];
73+
patches = [ ./nix-tinycbor-cmake.patch ];
6374

64-
nativeBuildInputs =
65-
with pkgs; [
75+
nativeBuildInputs = with pkgs; [
6676
pkg-config
6777
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+
))
8695
myStdenv.cc
8796
myLLVM.libclang
8897
myLLVM.clang
8998
myLLVM.llvm
9099
myLLVM.libllvm
91100
];
92101

93-
buildInputs =
94-
with pkgs; [
102+
buildInputs = with pkgs; [
95103
rustPlatform.bindgenHook
96104
myStdenv.cc
97105
myLLVM.libclang
@@ -104,22 +112,28 @@
104112
fenixToolchain
105113
];
106114

107-
cargoLock = {
108-
lockFile = ./Cargo.lock;
109-
};
110-
});
115+
cargoLock = {
116+
lockFile = ./Cargo.lock;
117+
};
118+
}
119+
);
111120
};
112121
defaultPackage = packages.default;
113122

114123
devShells = {
115124
# 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+
);
121134
};
122135

123136
devShell = devShells.default;
124-
});
137+
}
138+
);
125139
}

0 commit comments

Comments
 (0)