1
0
mirror of https://github.com/asciinema/avt.git synced 2025-04-19 05:22:19 +03:00

Use oxalica/rust-overlay in dev shell flake

This commit is contained in:
Marcin Kulik 2024-07-23 22:18:44 +02:00
parent 52b9af7f27
commit 3d66225c0d
3 changed files with 60 additions and 12 deletions

View File

@ -7,6 +7,9 @@ repository = "https://github.com/asciinema/avt"
description = "asciinema virtual terminal"
license = "Apache-2.0"
# MSRV
rust-version = "1.70.0"
[dependencies]
serde = { version = "1.0.130", features = ["derive"] }
rgb = "0.8.33"

37
flake.lock generated
View File

@ -34,10 +34,45 @@
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1718428119,
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1721701191,
"narHash": "sha256-nM4szL90VeZHZEC5rFfaiiPNTVOmsihdtk2QSP1l37I=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "4674ff2c2e5423a0cebe16e61aa874c359306af4",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {

View File

@ -2,20 +2,30 @@
description = "asciinema virtual terminal";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable;
flake-utils.url = github:numtide/flake-utils;
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
devShells.default = pkgs.mkShell {
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
let
packageToml =
(builtins.fromTOML (builtins.readFile ./Cargo.toml)).package;
msrv = packageToml.rust-version;
in flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
mkDevShell = rust:
pkgs.mkShell {
nativeBuildInputs = [
pkgs.rustup
(rust.override { extensions = [ "rust-src" "rust-analyzer" ]; })
];
};
}
);
in {
devShells.default = mkDevShell pkgs.rust-bin.stable.latest.default;
devShells.msrv = mkDevShell pkgs.rust-bin.stable.${msrv}.default;
});
}