-
Notifications
You must be signed in to change notification settings - Fork 12
/
flake.nix
66 lines (57 loc) · 1.57 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
58
59
60
61
62
63
64
65
66
{
description = "nixpkgs with the unfree bits enabled";
outputs =
inputs@{ self, nixpkgs }:
let
# Support the same list of systems as upstream.
systems = lib.systems.flakeExposed;
hydraSystems = [
"x86_64-linux"
"aarch64-linux"
];
lib = nixpkgs.lib;
eachSystem = lib.genAttrs systems;
in
{
# Inherit from upstream
inherit (nixpkgs) lib nixosModules htmlDocs;
# But replace legacyPackages with the unfree version
legacyPackages = eachSystem (
system:
import nixpkgs {
inherit system;
config = {
allowUnfree = true;
allowUnsupportedSystem = true;
cudaSupport = true;
};
}
);
templates = {
devShell = {
description = "devshell with nixpkgs-unfree";
path = ./templates/dev-shell;
};
default = {
description = "flake with nixpkgs-unfree";
path = ./templates/default;
};
};
devShells = eachSystem (system: {
default =
with self.legacyPackages.${system};
mkShell {
packages = [
jq
nix-eval-jobs
];
};
});
# And load all the unfree+redistributable packages as checks
checks = eachSystem (system: import ./checks.nix { inherit nixpkgs system; });
hydraJobs = {
# Re-expose the flake checks as hydra jobs.
checks = lib.genAttrs hydraSystems (system: self.checks.${system});
};
};
}