-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathflake.nix
47 lines (41 loc) · 1.16 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
{
description = "ollama: Get up and running with Llama 2, Mistral, and other large language models locally";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs-unfree = {
url = "github:numtide/nixpkgs-unfree";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs, nixpkgs-unfree, ... }:
let
inherit (nixpkgs) lib;
forAllSystems =
systems: buildPackages:
lib.genAttrs systems (system: buildPackages nixpkgs-unfree.legacyPackages.${system});
buildPackages =
systems: packageOverrides:
forAllSystems systems (
pkgs: builtins.mapAttrs (_: pkgs.callPackage ./package.nix) (packageOverrides pkgs)
);
unixPackages = buildPackages lib.platforms.unix (pkgs: {
default = { };
});
linuxPackages = buildPackages lib.platforms.linux (pkgs: {
default = { };
rocm = {
acceleration = "rocm";
};
cuda = {
acceleration = "cuda";
};
cpu = {
acceleration = false;
};
});
in
{
packages = unixPackages // linuxPackages;
};
}