-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
49 lines (47 loc) · 1.49 KB
/
flake.nix
File metadata and controls
49 lines (47 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
description = "nvidia-video-codec-sdk";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
zig = {
url = "github:mitchellh/zig-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
zls = {
url = "github:zigtools/zls";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self, nixpkgs, ... }@inputs:
inputs.flake-utils.lib.eachSystem (builtins.attrNames inputs.zig.packages) (
system:
let
overlays = [
(final: prev: { zigpkgs = inputs.zig.packages.${prev.system}; })
(final: prev: { zlspkgs = inputs.zls.packages.${prev.system}; })
];
pkgs = import nixpkgs { inherit overlays system; };
in
{
devShells.default = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
packages = with pkgs; [
zigpkgs.default
zls
];
# This is the equivalent of addDriverRunpath for dev shell. In a Nix
# build we would use addDriverRunpath to patch the binary rpath to
# load the driver libraries. In a devshell we do not have access to
# the binary so we just add the driver library path to
# LD_LIBRARY_PATH.
shellHook = ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/run/opengl-driver/lib/";
'';
};
}
);
}