-
Notifications
You must be signed in to change notification settings - Fork 1
/
channels.nix
136 lines (118 loc) · 4.92 KB
/
channels.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
let
channels = {
nixpkgs-stable = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/c0b1da36f7c34a7146501f684e9ebdf15d2bebf8.tar.gz";
sha256 = "0j15vhfz4na8wmvp532jya81y06g74qkr25ci58dp895bw7l9g2q";
}) {
system = "x86_64-linux";
overlays = with overlays; [ pythonInterpreterOverlay ];
config.allowUnfree = true;
};
nixpkgs-unstable = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/3f9b169c4bff458f5b9462452fb048c207cd5fe2.tar.gz";
sha256 = "0nraxyxm7drzg55innailxg3lmlz7ndggrw34nky04lr7l0k5ma9";
}) {
system = "x86_64-linux";
overlays = with overlays; [
pinPackagesToSpecificVersionOverlay
pythonPackagesOverlay
pinPackagesToStableOverlay
patchPackagesOverlay
homeManagerPinOverlay
nixglOverlay
];
config.allowUnfree = true;
config.packageOverrides = pkgs: {
nur = channels.nur;
};
};
home-manager = (builtins.fetchTarball {
url = "https://github.com/nix-community/home-manager/archive/1d0862ee2d7c6f6cd720d6f32213fa425004be10.tar.gz";
sha256 = "0hqmxdp6wz8z305w7pb582ardsyn45wgr55mck2isk43jrjriba2";
});
# NUR and nixvim overlays
nur = import (builtins.fetchTarball {
url = "https://github.com/nix-community/NUR/archive/27913565fdb9db9c0f078aa36ccfab943a777ae3.tar.gz";
sha256 = "1d156ninl270mgy5ix89mx08qmk151ivxnr9c2m05ssi3l9wqx2s";
}) { pkgs = channels.nixpkgs-unstable; };
nixvim = import (builtins.fetchTarball {
url = "https://github.com/nix-community/nixvim/archive/42ea1626cb002fa759a6b1e2841bfc80a4e59615.tar.gz";
sha256 = "0ajfx35h4z3814p2cpbz4yh0ds948h9x8kgv7kbqnjjjlh72jgp7";
});
};
overlays = {
# By default, if we attempt to use a Python package from Stable, while using Unstable's Python
# We will end up with a hash collision.
#
# This is because there will be 2 versions of Python installed
# (it can actually be the same version but different hash)
#
# By pinning Stable's Python to Unstable's Python,
# the build process and subsequent Python packages will not cause this hash collision.
pythonInterpreterOverlay = self: super: {
python312 = channels.nixpkgs-unstable.python312;
};
# Some packages are broken in unstable, use the stable versions instead
pinPackagesToStableOverlay = self: super: {
contour = channels.nixpkgs-stable.contour;
};
# This overlay is to pin Home-Manager's src to a specific hash
homeManagerPinOverlay = self: super: {
home-manager = super.home-manager.overrideAttrs (oldAttrs: {
src = channels.home-manager;
});
};
pinPackagesToSpecificVersionOverlay = self: super: {
unicorn = super.unicorn.overrideAttrs (oldAttrs: {
src = super.fetchFromGitHub {
owner = "unicorn-engine";
repo = "unicorn";
rev = "2.0.1.post1";
hash = "sha256-Jz5C35rwnDz0CXcfcvWjkwScGNQO1uijF7JrtZhM7mI=";
};
});
};
# This overlay is for when a package exists on NixPkgs, but a custom patch is required
patchPackagesOverlay = self: super: {
# Innoextract with custom patch to allow for extracting CompiledCode.bin file
innoextract = super.innoextract.overrideAttrs (oldAttrs: {
version = "1.10-dev-patched";
src = channels.nixpkgs-unstable.fetchFromGitHub {
owner = "dscharrer";
repo = "innoextract";
rev = "264c2fe6b84f90f6290c670e5f676660ec7b2387";
hash = "sha256-DLQ1gphCr4haaBppAJh+zyg0ObjHzO9xLFgHpRb1f0Y=";
};
patches = [ ./innoextract/extract_compiled_code.patch ];
});
};
# Fix Python package issues
pythonPackagesOverlay = self: super: {
python312Packages = super.python312Packages.override {
overrides = pythonSelf: pythonSuper: {
# The NixPkg for angr uses protobuf4, although it works with protobuf5
# By forcing protobuf5 here, conflicts of multiple versions existing is prevented
protobuf = pythonSuper.protobuf5;
# Unicorn v2.0.1 still requires setuptools+distutils
unicorn = pythonSuper.unicorn.overrideAttrs (oldAttrs: {
propagatedBuildInputs = with super.python312Packages; [ setuptools distutils ];
});
# Suppress broken state as the version of Unicorn is correctly pinned
angr = pythonSuper.angr.overrideAttrs (oldAttrs: {
meta = oldAttrs.meta // {
broken = false;
};
});
};
};
};
};
nixglOverlay = self: super: {
nixGL = super.callPackage (builtins.fetchTarball {
url = "https://github.com/nix-community/nixGL/archive/310f8e49a149e4c9ea52f1adf70cdc768ec53f8a.tar.gz";
sha256 = "1crnbv3mdx83xjwl2j63rwwl9qfgi2f1lr53zzjlby5lh50xjz4n";
}) {};
};
in {
channels = channels;
}