feat: switch to rust-overlay
This commit is contained in:
parent
7c14a2bd00
commit
3e0b846a3a
2 changed files with 48 additions and 7 deletions
23
flake.lock
23
flake.lock
|
@ -39,7 +39,28 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs",
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1722046723,
|
||||||
|
"narHash": "sha256-G7/gHz8ORRvHd1/RIURrdcswKRPe9K0FsIYR4v5jSWo=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "56baac5e6b2743d4730e664ea64f6d8a2aad0fbb",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
32
flake.nix
32
flake.nix
|
@ -6,11 +6,18 @@
|
||||||
url = "github:hercules-ci/flake-parts";
|
url = "github:hercules-ci/flake-parts";
|
||||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
rust-overlay = {
|
||||||
|
url = "github:oxalica/rust-overlay";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
self,
|
self,
|
||||||
|
nixpkgs,
|
||||||
flake-parts,
|
flake-parts,
|
||||||
|
rust-overlay,
|
||||||
...
|
...
|
||||||
} @ inputs:
|
} @ inputs:
|
||||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||||
|
@ -18,17 +25,30 @@
|
||||||
|
|
||||||
perSystem = {
|
perSystem = {
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
system,
|
||||||
self',
|
self',
|
||||||
...
|
...
|
||||||
}: {
|
}: let
|
||||||
packages.default = pkgs.callPackage ./derivation.nix {inherit self;};
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [(import rust-overlay)];
|
||||||
|
};
|
||||||
|
|
||||||
|
toolchain = pkgs.rust-bin.stable.latest.default;
|
||||||
|
rustPlatform = pkgs.makeRustPlatform {
|
||||||
|
rustc = toolchain;
|
||||||
|
cargo = toolchain;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
packages.default = pkgs.callPackage ./derivation.nix {inherit self rustPlatform;};
|
||||||
|
|
||||||
devShells.default = with pkgs;
|
devShells.default = with pkgs;
|
||||||
mkShell {
|
mkShell {
|
||||||
packages = [clippy rustfmt rust-analyzer];
|
buildInputs = [
|
||||||
inputsFrom = [self'.packages.default];
|
(toolchain.override {
|
||||||
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
|
extensions = ["rust-analyzer" "rust-src"];
|
||||||
|
})
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
formatter = pkgs.alejandra;
|
formatter = pkgs.alejandra;
|
||||||
|
|
Loading…
Reference in a new issue