From adb174d98530391856ea99a308e9c725fcebb343 Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Sun, 2 Mar 2025 11:12:38 -0800 Subject: [PATCH] don't use `file` type flake inputs Because they aren't supported by flake-compat and can't be without IFD. --- flake.lock | 15 +-------------- flake.nix | 16 ++++++++-------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/flake.lock b/flake.lock index 57242b6f..329c78a4 100644 --- a/flake.lock +++ b/flake.lock @@ -267,8 +267,7 @@ "flake-utils": "flake-utils", "nix-filter": "nix-filter", "nixpkgs": "nixpkgs_2", - "rocksdb": "rocksdb", - "rust-manifest": "rust-manifest" + "rocksdb": "rocksdb" } }, "rust-analyzer-src": { @@ -288,18 +287,6 @@ "type": "github" } }, - "rust-manifest": { - "flake": false, - "locked": { - "narHash": "sha256-dm4qOlaZ/uZ+O2TmOrWEjjMAzZNWAGE8S0ne79Fo8OA=", - "type": "file", - "url": "https://static.rust-lang.org/dist/channel-rust-1.84.0.toml" - }, - "original": { - "type": "file", - "url": "https://static.rust-lang.org/dist/channel-rust-1.84.0.toml" - } - }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index d704a0fd..c997779c 100644 --- a/flake.nix +++ b/flake.nix @@ -9,16 +9,16 @@ nix-filter.url = "github:numtide/nix-filter?ref=main"; nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable"; rocksdb = { url = "github:facebook/rocksdb?ref=v9.7.4"; flake = false; }; - - rust-manifest = { - # Keep version in sync with rust-toolchain.toml - url = "https://static.rust-lang.org/dist/channel-rust-1.84.0.toml"; - flake = false; - }; }; outputs = inputs: let + rust-manifest = builtins.fetchurl { + # Keep version in sync with rust-toolchain.toml + url = "https://static.rust-lang.org/dist/channel-rust-1.84.0.toml"; + sha256 = "sha256-lMLAupxng4Fd9F1oDw8gx+qA0RuF7ou7xhNU8wgs0PU="; + }; + # Keep sorted mkScope = pkgs: pkgs.lib.makeScope pkgs.newScope (self: { craneLib = @@ -60,11 +60,11 @@ targets = toolchainFile.toolchain.targets; fenix = inputs.fenix.packages.${pkgs.stdenv.buildPlatform.system}; - nativeToolchain = (fenix.fromManifestFile inputs.rust-manifest) + nativeToolchain = (fenix.fromManifestFile rust-manifest) .withComponents components; crossComponents = builtins.map (target: - (fenix.targets.${target}.fromManifestFile inputs.rust-manifest) + (fenix.targets.${target}.fromManifestFile rust-manifest) .rust-std) targets; in