rustenstein/flake.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

2023-02-19 23:56:21 +01:00
{
description = "Doggo flake";
2023-02-20 15:16:34 +01:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
2023-02-19 23:56:21 +01:00
2023-02-20 15:16:34 +01:00
outputs = { self, nixpkgs, crane, flake-utils, rust-overlay }:
flake-utils.lib.eachSystem [ flake-utils.lib.system.x86_64-linux ] (system:
let
pkgs = import nixpkgs {
system = system;
overlays = [ (import rust-overlay) ];
};
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
craneLib = crane.lib.${system}.overrideToolchain rustToolchain;
in {
packages.default = craneLib.buildPackage {
src = craneLib.cleanCargoSource ./.;
2023-02-20 15:49:42 +01:00
};
2023-02-19 23:56:21 +01:00
2023-02-20 15:49:42 +01:00
devShells.default = pkgs.mkShell {
# Host tools
2023-02-20 15:16:34 +01:00
nativeBuildInputs = with pkgs; [
2023-02-19 23:56:21 +01:00
just
2023-02-20 15:49:42 +01:00
rustToolchain
2023-02-20 00:13:54 +01:00
rust-analyzer
2023-02-19 23:56:21 +01:00
];
};
2023-02-20 15:16:34 +01:00
}
);
2023-02-19 23:56:21 +01:00
}