diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-09 22:43:25 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-09 22:43:25 +0300 |
| commit | b137c7b5ea551aec2a186fea51a0959461c032d9 (patch) | |
| tree | 65c6ae4d3fe9c737eb16380ec0f887bc56392b3d /flake.nix | |
| parent | 9c4534276614653e51cfcff1fb4f9040129e8a11 (diff) | |
ci: pin rust toolchain to 1.96.1
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 47 |
1 files changed, 37 insertions, 10 deletions
@@ -3,10 +3,18 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = - { self, nixpkgs }: + { + self, + nixpkgs, + rust-overlay, + }: let lib = nixpkgs.lib; systems = [ @@ -16,14 +24,31 @@ "aarch64-darwin" ]; forAllSystems = lib.genAttrs systems; - pkgsFor = system: import nixpkgs { inherit system; }; + pkgsFor = + system: + import nixpkgs { + inherit system; + overlays = [ rust-overlay.overlays.default ]; + }; + rustToolchainFor = pkgs: pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + rustPlatformFor = + pkgs: + let + rustToolchain = rustToolchainFor pkgs; + in + pkgs.makeRustPlatform { + cargo = rustToolchain; + rustc = rustToolchain; + }; in { packages = forAllSystems ( system: let pkgs = pkgsFor system; - herdr = pkgs.callPackage ./nix/package.nix { }; + herdr = pkgs.callPackage ./nix/package.nix { + rustPlatform = rustPlatformFor pkgs; + }; in { inherit herdr; @@ -48,20 +73,18 @@ system: let pkgs = pkgsFor system; + rustToolchain = rustToolchainFor pkgs; in { default = pkgs.mkShell { name = "herdr-dev"; packages = with pkgs; [ - cargo cargo-nextest - clippy cmake just ninja pkg-config - rustc - rustfmt + rustToolchain zig_0_15 ]; @@ -75,8 +98,12 @@ formatter = forAllSystems (system: (pkgsFor system).nixfmt); - overlays.default = final: _prev: { - herdr = final.callPackage ./nix/package.nix { }; - }; + overlays.default = lib.composeExtensions rust-overlay.overlays.default ( + final: _prev: { + herdr = final.callPackage ./nix/package.nix { + rustPlatform = rustPlatformFor final; + }; + } + ); }; } |
