I am using nix-darwin
, and I am trying to write a derivation for rust-analyzer
. This is my code in the derivation file(There are many things missing and I guess I should not fetch the executable directly?):
{ config, lib, pkgs, ... }:
stdenv.mkDerivation {
name = "rust-analyzer";
src = builtins.fetchurl{
url = "https://github.com/rust-analyzer/rust-analyzer/releases/download/2021-06-21/rust-analyzer-aarch64-apple-darwin.gz";
sha256 = "0x2g1jqygyr5wiwg4ma1nd7w4ydpy82z9gkcv8vh2v8dn3y58v5m";
};
installPhase = ''
mkdir -p $out/bin
mv rust-analyzer-aarch64-apple-darwin rust-analyzer
cp rust-analyzer $out/bin
'';
}
And this is my config file for nix-darwin
, which I have imported the derivation file
{ config, pkgs, ... }:
{
nixpkgs.overlays = [
(import (builtins.fetchTarball {
url =
"https://github.com/nix-community/neovim-nightly-overlay/archive/master.tar.gz";
}))
];
nixpkgs.config = {
allowUnfree = true;
};
environment.systemPackages = [
import ./rust-analyzer.nix {}
]
But I got this error, and I have no idea how to debug it:
error: 'functionArgs' requires a function, at /nix/store/46lqa5vk43ldwql2vkdcsxs70139j22z-nixpkgs-21.11pre297787.1c203a23254/nixpkgs/lib/trivial.nix:337:42
(use '--show-trace' to show detailed location information)