-
Notifications
You must be signed in to change notification settings - Fork 125
/
flake.nix
57 lines (51 loc) · 1.56 KB
/
flake.nix
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
50
51
52
53
54
55
56
57
{
description = "blitzar build environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# nixpkgsGcc is pinned to an older version of nixpkgs
# with glibc 2.31
#
# Linking against an older version of glibc allows us
# to produce a more portable binary
nixpkgsGcc.url = "github:nixos/nixpkgs/nixos-unstable";
# GPU drivers update frequently so we allow the version
# of nixpkgs used for drivers to vary independently so
# that we don't need to update everything else to get
# the latest drivers
nixpkgsDrv.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, nixpkgsDrv, nixpkgsGcc, rust-overlay, }:
let
system = "x86_64-linux";
pkgsDrv = import nixpkgsDrv {
inherit system;
config.allowUnfree = true;
config.cudaSupport = true;
};
pkgsGcc = import nixpkgsGcc {
inherit system;
};
driverOverlay = final: prev: {
cudaDrivers = pkgsDrv.linuxPackages.nvidia_x11;
};
gccOverlay = final: prev: {
portableGcc = pkgsGcc.gcc;
};
overlays = [
driverOverlay
gccOverlay
(import rust-overlay)
];
pkgs = import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
config.cudaSupport = true;
};
shell = import ./nix/shell.nix { inherit pkgs; };
in
{
formatter.${system} = pkgs.nixpkgs-fmt;
devShells.${system}.default = shell;
};
}