I’m currently trying to build the latest commit of vulkan-validation-layers with the following setup:
vulkan-validation-layers = prev.vulkan-validation-layers.overrideAttrs (old: {
version = "1.4.343.0";
src = pkgs.fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-ValidationLayers";
rev = "11440fc0664718ac51646c63d6e321f61195e808";
hash = "sha256-iAOUwTAU8VdrMNDYlPHWqPKtzDZOHRxNq4nsEmDbsug=";
};
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.git ];
});
However, I’m getting the following error message:
building vulkan-validation-layers-1.4.343.0 (configurePhase): fatal: unable to access 'https://github.com/KhronosGroup/Vulkan-Headers.git/': Could not resolve host: github.com
The reason seems to be that each derivation won’t have internet access during the build but if I change my setup above to this:
vulkan-validation-layers = prev.vulkan-validation-layers.overrideAttrs (old: {
version = "1.4.343.0";
src = pkgs.fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-ValidationLayers";
rev = "11440fc0664718ac51646c63d6e321f61195e808";
hash = "sha256-iAOUwTAU8VdrMNDYlPHWqPKtzDZOHRxNq4nsEmDbsug=";
};
});
then I’m getting the following error message:
error: builder for '/nix/store/wh8yf4jdfqizr6159kwyjapnwanw04m3-vulkan-validation-layers-1.4.343.0.drv' failed with exit code 1;
last 25 log lines:
> command_output(['git', 'clone', self.url, '.'], self.repo_dir)
> ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/build/source/scripts/update_deps.py", line 325, in command_output
> result = subprocess.run(cmd, cwd=directory, capture_output=True, text=True, errors='replace')
> File "/nix/store/qzc04a3npl70cyyy6flnnrb2ig3kayxm-python3-3.13.11/lib/python3.13/subprocess.py", line 554, in run
> with Popen(*popenargs, **kwargs) as process:
> ~~~~~^^^^^^^^^^^^^^^^^^^^^^
> File "/nix/store/qzc04a3npl70cyyy6flnnrb2ig3kayxm-python3-3.13.11/lib/python3.13/subprocess.py", line 1039, in __init__
> self._execute_child(args, executable, preexec_fn, close_fds,
> ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> pass_fds, cwd, env,
> ^^^^^^^^^^^^^^^^^^^
> ...<5 lines>...
> gid, gids, uid, umask,
> ^^^^^^^^^^^^^^^^^^^^^^
> start_new_session, process_group)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/nix/store/qzc04a3npl70cyyy6flnnrb2ig3kayxm-python3-3.13.11/lib/python3.13/subprocess.py", line 1991, in _execute_child
> raise child_exception_type(errno_num, err_msg, err_filename)
> FileNotFoundError: [Errno 2] No such file or directory: 'git'
> CMake Error at scripts/CMakeLists.txt:133 (message):
> Could not run update_deps.py which is necessary to download dependencies.
How… can I build vulkan-validation-layers? (@Ralith I hope it’s fine to ping since you are the maintainer of the vulkan-validation-layers package)
Minimal flake
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; }
{
systems = [
"x86_64-linux"
"aarch64-linux"
];
perSystem = { self', lib, system, pkgs, config, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
(final: prev:
let
version = "1.4.343.0";
in
{
vulkan-loader = prev.vulkan-loader.overrideAttrs (old: {
inherit version;
src = prev.fetchFromGitHub {
owner = "charles-lunarg";
repo = "Vulkan-Loader";
rev = "5b0ed940054d35d2b07840b02c1b8e0c2bf2e5cc";
hash = "sha256-AVd0Q2axESlFVShjNFUFoc1fQfvHP3/QfNtbD92jujg=";
};
});
vulkan-headers = prev.vulkan-headers.overrideAttrs (old: {
inherit version;
src = prev.fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-Headers";
rev = "49f1a381e2aec33ef32adf4a377b5a39ec016ec4";
hash = "sha256-K/8X9D7B0o6+osOzScplwea+OsfM3srAtDKCgfZpcJU=";
};
});
vulkan-validation-layers = prev.vulkan-validation-layers.overrideAttrs (old: {
inherit version;
src = pkgs.fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-ValidationLayers";
rev = "8166b45f45f15eab64e73480de22fd3004480215";
hash = "sha256-LafNnTVTpGWlVEBUwk6RCPjkt+RORj4UbvyoKBMqO8U=";
};
# uncomment this to avoid cloning during build
# cmakeFlags = old.cmakeFlags ++ [ "-DUPDATE_DEPS=false" ];
});
})
];
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
vulkan-loader
vulkan-validation-layers
];
};
};
};
}