flake: compact
This commit is contained in:
parent
b6ec8a4009
commit
fb31db723f
1 changed files with 4 additions and 23 deletions
27
flake.nix
27
flake.nix
|
@ -1,29 +1,16 @@
|
||||||
{
|
{
|
||||||
description = "Rust development environment for bunbun using fenix";
|
description = "Rust development environment for bunbun using fenix";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
fenix = {
|
fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs-unstable"; };
|
||||||
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";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = { self, nixpkgs-unstable, utils, fenix, ... }:
|
||||||
self,
|
|
||||||
nixpkgs-unstable,
|
|
||||||
utils,
|
|
||||||
fenix,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
utils.lib.eachDefaultSystem
|
utils.lib.eachDefaultSystem
|
||||||
(
|
(
|
||||||
system: let
|
system: let
|
||||||
pkgs = import nixpkgs-unstable {
|
pkgs = import nixpkgs-unstable { inherit system; overlays = [fenix.overlays.default]; };
|
||||||
inherit system;
|
|
||||||
overlays = [fenix.overlays.default];
|
|
||||||
};
|
|
||||||
toolchain = pkgs.fenix.complete;
|
toolchain = pkgs.fenix.complete;
|
||||||
in rec
|
in rec
|
||||||
{
|
{
|
||||||
|
@ -37,16 +24,10 @@
|
||||||
src = ./.;
|
src = ./.;
|
||||||
cargoLock.lockFile = ./Cargo.lock;
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Executed by `nix run`
|
|
||||||
apps.default = utils.lib.mkApp {drv = packages.default;};
|
apps.default = utils.lib.mkApp {drv = packages.default;};
|
||||||
|
|
||||||
# Used by `nix develop`
|
|
||||||
devShells.default = pkgs.mkShell rec {
|
devShells.default = pkgs.mkShell rec {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
(with toolchain; [
|
(with toolchain; [ cargo rustc rust-src clippy rustfmt ])
|
||||||
cargo rustc rust-src clippy rustfmt # rust components
|
|
||||||
])
|
|
||||||
];
|
];
|
||||||
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library";
|
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue