I have the following flake.nix
, but I cannot access the llvm-as
correctly to define a symlink to the version:
{
nixConfig = {
substituters = [
# Add here some other mirror if needed.
"https://cache.nixos.org/"
];
extra-substituters = [
# Nix community's cache server
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# You can access packages and modules from different nixpkgs revs
# at the same time. Here's an working example:
nixpkgsStable.url = "github:nixos/nixpkgs/nixos-23.11";
# Also see the 'stable-packages' overlay at 'overlays/default.nix'.
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
nixpkgsStable,
flake-utils,
...
} @ inputs:
flake-utils.lib.eachDefaultSystem
# Creates an attribute map `{ devShells.<system>.default = ...}`
# by calling this function:
(
system: let
overlays = [];
# Import nixpkgs and load it into pkgs.
pkgs = import nixpkgs {
inherit system overlays;
};
nodePackages = pkgs.callPackage ./tools/nix/node-packages/default.nix {};
clangVersion = "16";
llvmPkgs = pkgs."llvmPackages_${clangVersion}";
compilerLinks = pkgs.runCommand "clang-links" {} ''
mkdir -p $out/bin
ln -s ${llvmPkgs.libstdcxxClang}/bin/clang $out/bin/clang-${clangVersion}
ln -s ${llvmPkgs.libstdcxxClang}/bin/clang++ $out/bin/clang++-${clangVersion}
#### THIS SYMLINK DOES NOT WORK, llvm-as is somewhere else but where?
ln -s ${llvmPkgs.libstdcxxClang.bintools}/bin/llvm-as $out/bin/llvm-as-${clangVersion}
'';
buildInputs = with pkgs; [
# C++
llvmPkgs.bintools
llvmPkgs.openmp
llvmPkgs.lld
llvmPkgs.llvm
llvmPkgs.lldb
# llvmPkgs.libclc
llvmPkgs.libclang
llvmPkgs.libllvm
llvmPkgs.libcxx
(hiPrio llvmPkgs.libstdcxxClang)
compilerLinks
];
in {
devShells = {
default = pkgs.mkShell {
inherit buildInputs;
};
};
}
);
}
The symlink
for llvm-as
is wrong, but I do not know how to investigate, and fix these problems.
I tried searching with nix repl -f <nixpkgs>
and pkgs.llvmPackages_16.libstdcxxClang.bintools.outPath
etc.
Some hint would be very appreciated.