refactor: use a more generic flake style
This commit is contained in:
parent
4bdb51968f
commit
d7b77fe5b5
1 changed files with 10 additions and 8 deletions
18
flake.nix
18
flake.nix
|
|
@ -15,20 +15,22 @@
|
||||||
cargoToml = fromTOML (builtins.readFile ./Cargo.toml);
|
cargoToml = fromTOML (builtins.readFile ./Cargo.toml);
|
||||||
name = cargoToml.package.name;
|
name = cargoToml.package.name;
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
crate = pkgs.rustPlatform.buildRustPackage {
|
||||||
m4
|
inherit name;
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
packages.default = pkgs.rustPlatform.buildRustPackage {
|
|
||||||
inherit name nativeBuildInputs;
|
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
cargoLock.lockFile = ./Cargo.lock;
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
m4
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages.default = crate;
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
inherit nativeBuildInputs;
|
inputsFrom = [ crate ];
|
||||||
|
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
rustc
|
rustc
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue