From 3d0d32c66b22b1fe85bac215bac95cb8642d25fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Lelong?= Date: Tue, 19 Dec 2023 21:28:33 +0100 Subject: [PATCH] update flake --- .gitignore | 3 ++- flake.lock | 56 +++++++++++++----------------------------------------- flake.nix | 44 +++++++++++++++++++++++++++++------------- 3 files changed, 46 insertions(+), 57 deletions(-) diff --git a/.gitignore b/.gitignore index a4ae325..c72de89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ Cargo.lock target/ .envrc -.direnv/ \ No newline at end of file +.direnv/ +firedbg \ No newline at end of file diff --git a/flake.lock b/flake.lock index 5709e57..b83ab8b 100644 --- a/flake.lock +++ b/flake.lock @@ -18,52 +18,18 @@ "type": "github" } }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1697456312, - "narHash": "sha256-roiSnrqb5r+ehnKCauPLugoU8S36KgmWraHgRqVYndo=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "ca012a02bf8327be9e488546faecae5e05d7d749", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1681358109, - "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", + "lastModified": 1702830618, + "narHash": "sha256-lvhwIvRwhOLgzbRuYkqHy4M5cQHYs4ktL6/hyuBS6II=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9", + "rev": "91a00709aebb3602f172a0bf47ba1ef013e34835", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -77,15 +43,19 @@ }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1697681535, - "narHash": "sha256-vVkqg+qTgTQ/YEreZyi/eyxoj26yyowI4/5ffTGT90w=", + "lastModified": 1702952173, + "narHash": "sha256-24kUnTZgXP5B/fs1/f61tJuHyFrJ8824rn1B/0hL1og=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "d5977a020c216526144dbf08ab0825b6c1121593", + "rev": "20fd62b0891707a1db8117d09fc3e65a1cd0f6d7", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 9cabad8..8d57b94 100644 --- a/flake.nix +++ b/flake.nix @@ -1,20 +1,38 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - rust-overlay.url = "github:oxalica/rust-overlay"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; }; - outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: - flake-utils.lib.eachDefaultSystem (system: - let - overlays = [ (import rust-overlay) ]; - pkgs = import nixpkgs { inherit system overlays; }; - rustStable = pkgs.rust-bin.stable.latest.minimal.override { - extensions = [ "rust-src" "clippy" "rustfmt" ]; + outputs = { + self, + nixpkgs, + flake-utils, + rust-overlay, + }: + flake-utils.lib.eachDefaultSystem + ( + system: let + overlays = [(import rust-overlay)]; + pkgs = import nixpkgs { + inherit system overlays; }; - in with pkgs; { - devShell = mkShell { - buildInputs = [ openssl pkg-config rustStable cargo-release ]; + rustToolchain = pkgs.pkgsBuildHost.rust-bin.nightly.latest.default.override { + extensions = ["rust-src" "rust-analyzer" "rustc-codegen-cranelift-preview"]; }; - }); + in + with pkgs; { + devShells.default = mkShell { + nativeBuildInputs = with pkgs; [rustToolchain pkg-config]; + buildInputs = with pkgs; [openssl clang cargo-release]; + RUST_BACKTRACE = "1"; + }; + } + ); }