flake: clean of Rust installation
This commit is contained in:
parent
d8ec881d70
commit
8d95397e9a
24
flake.nix
24
flake.nix
|
@ -2,10 +2,6 @@
|
||||||
description = "Rust development environment for oxitoko using fenix";
|
description = "Rust development environment for oxitoko using fenix";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
fenix = {
|
|
||||||
url = "github:nix-community/fenix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
|
||||||
};
|
|
||||||
utils.url = "github:numtide/flake-utils";
|
utils.url = "github:numtide/flake-utils";
|
||||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
};
|
};
|
||||||
|
@ -14,26 +10,19 @@
|
||||||
self,
|
self,
|
||||||
nixpkgs-unstable,
|
nixpkgs-unstable,
|
||||||
utils,
|
utils,
|
||||||
fenix,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
utils.lib.eachDefaultSystem
|
utils.lib.eachDefaultSystem
|
||||||
(
|
(
|
||||||
system: let
|
system: let
|
||||||
pkgs = import nixpkgs-unstable {
|
pkgs = import nixpkgs-unstable { inherit system; };
|
||||||
inherit system;
|
|
||||||
overlays = [fenix.overlays.default];
|
|
||||||
};
|
|
||||||
toolchain = pkgs.fenix.complete;
|
toolchain = pkgs.fenix.complete;
|
||||||
dependencies = with pkgs; [ SDL2 SDL2_image ];
|
dependencies = with pkgs; [ SDL2 SDL2_image ];
|
||||||
in rec
|
in rec
|
||||||
{
|
{
|
||||||
# Executed by `nix build`
|
# Executed by `nix build`
|
||||||
packages.default =
|
packages.default =
|
||||||
(pkgs.makeRustPlatform {
|
(pkgs.makeRustPlatform.buildRustPackage {
|
||||||
inherit (toolchain) cargo rustc;
|
|
||||||
})
|
|
||||||
.buildRustPackage {
|
|
||||||
pname = "rustboyadvance-ng";
|
pname = "rustboyadvance-ng";
|
||||||
name = "rustboyadvance-ng";
|
name = "rustboyadvance-ng";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
@ -51,14 +40,7 @@
|
||||||
apps.default = utils.lib.mkApp {drv = packages.default;};
|
apps.default = utils.lib.mkApp {drv = packages.default;};
|
||||||
|
|
||||||
# Used by `nix develop`
|
# Used by `nix develop`
|
||||||
devShells.default = pkgs.mkShell rec {
|
devShells.default = pkgs.mkShell rec { buildInputs = dependencies; };
|
||||||
buildInputs = with pkgs; [
|
|
||||||
(with toolchain; [
|
|
||||||
cargo rustc rust-src clippy rustfmt # rust components
|
|
||||||
])
|
|
||||||
] ++ dependencies;
|
|
||||||
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue