-
Notifications
You must be signed in to change notification settings - Fork 9
/
flake.nix
269 lines (214 loc) · 7.96 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
{
description = "Funkwhale";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
outputs = { self, nixpkgs }:
let
version = "1.3.3";
systems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
# Memoize nixpkgs for different platforms for efficiency.
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
}
);
in
{
overlays.default = final: prev: {
funkwhale-front = with final; stdenv.mkDerivation {
pname = "funkwhale-front";
inherit version;
nativeBuildInputs = [ pkgs.unzip ];
unpackCmd = "unzip $curSrc";
src = fetchurl {
url =
"https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/${version}/download?job=build_front";
sha256 = "sha256-0DOcTkKKU+REoMTJQW11hrrND88eTQ2+tIuQRzxa0rw=";
};
installPhase = ''
mkdir $out
cp -R ./dist/* $out
'';
};
funkwhale = with final; (stdenv.mkDerivation {
pname = "funkwhale";
inherit version;
src = fetchurl {
url = "https://dev.funkwhale.audio/funkwhale/funkwhale/-/archive/${version}/funkwhale-${version}.tar.bz2";
sha256 = "sha256-bcJMY0Ndnlq5hKJVYMO/qwckYTZtABhDJem2C9E/zB4=";
};
patches = [ ./funkwhale.patch ];
installPhase = ''
sed "s|env -S|env|g" -i front/scripts/*.sh
mkdir $out
cp -R ./* $out
'';
meta = with lib; {
description = "A modern, convivial and free music server";
homepage = https://funkwhale.audio/;
license = licenses.agpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ mmai ];
};
});
# ------------- new packages -------------------
requests-http-message-signatures = with final; with pkgs.python3.pkgs; (buildPythonPackage rec {
pname = "requests-http-message-signatures";
version = "0.3.1";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-AjW7XNP0p9ZZZF4qyTfacnkTIUNOd1cPfiEELlEIINo=";
};
propagatedBuildInputs = [ requests cryptography ];
doCheck = false;
});
django-cache-memoize = with final; with pkgs.python3.pkgs; (buildPythonPackage rec {
pname = "django-cache-memoize";
version = "0.1.10";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-Y+j6okWkHA262EOAfp8hpuWeuo5uUN8xD99khaZ0mEM=";
};
propagatedBuildInputs = [ ];
doCheck = false;
});
django-versatileimagefield = with final; with pkgs.python3.pkgs; (buildPythonPackage rec {
pname = "django-versatileimagefield";
version = "3.0";
src = fetchPypi {
inherit pname version;
hash = "sha256-FlHbLtNthDz7F4jyYBRyopPZuoZyk2m29uVZERI1esc=";
};
propagatedBuildInputs = [ django pillow python-magic ];
nativeCheckInputs = [ django ];
# tests not included with pypi release
doCheck = false;
pythonImportsCheck = [ "versatileimagefield" ];
meta = with lib; {
description = "Replaces django's ImageField with a more flexible interface";
homepage = "https://github.com/respondcreate/django-versatileimagefield/";
license = licenses.mit;
maintainers = with maintainers; [ mmai ];
};
});
# ------------- will be in 23.11
jsonschema-specifications = with final; with pkgs.python3.pkgs; (buildPythonPackage rec {
pname = "jsonschema-specifications";
version = "2023.7.1";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchPypi {
pname = "jsonschema_specifications";
inherit version;
hash = "sha256-yRpQQE6Iofa6QGNneOLuCPbiTFYT/kxTrCRXilp/crs=";
};
nativeBuildInputs = [
hatch-vcs
hatchling
];
propagatedBuildInputs = [
referencing
] ++ lib.optionals (pythonOlder "3.9") [
importlib-resources
];
nativeCheckInputs = [
pytestCheckHook
];
pythonImportsCheck = [
"jsonschema_specifications"
];
meta = with lib; {
description = "Support files exposing JSON from the JSON Schema specifications";
homepage = "https://github.com/python-jsonschema/jsonschema-specifications";
license = licenses.mit;
maintainers = with maintainers; [ SuperSandro2000 ];
};
});
referencing = with final; with pkgs.python3.pkgs; (buildPythonPackage rec {
pname = "referencing";
version = "0.30.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "python-jsonschema";
repo = "referencing";
rev = "refs/tags/v${version}";
fetchSubmodules = true;
hash = "sha256-nJSnZM3gg2+yfFAnOJzzXsmIEQdNf5ypt5R0O60NphA=";
};
SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [
hatch-vcs
hatchling
];
propagatedBuildInputs = [
attrs
rpds-py
];
nativeCheckInputs = [
jsonschema
pytest-subtests
pytestCheckHook
];
# avoid infinite recursion with jsonschema
doCheck = false;
passthru.tests.referencing = self.overridePythonAttrs { doCheck = true; };
pythonImportsCheck = [
"referencing"
];
meta = with lib; {
description = "Cross-specification JSON referencing";
homepage = "https://github.com/python-jsonschema/referencing";
changelog = "https://github.com/python-jsonschema/referencing/blob/${version}/CHANGELOG.rst";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
});
rpds-py = with final; with pkgs.python3.pkgs; (buildPythonPackage rec {
pname = "rpds-py";
version = "0.9.2";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchPypi {
pname = "rpds_py";
inherit version;
hash = "sha256-jXDo8UkA8mV8JJ6k3vljvthqKbgfgfW3a1qSFWgN6UU=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-2LiQ+beFj9+kykObPNtqcg+F+8wBDzvWcauwDLHa7Yo=";
};
nativeBuildInputs = [
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
cargo
rustc
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
];
nativeCheckInputs = [
pytestCheckHook
];
pythonImportsCheck = [
"rpds"
];
meta = with lib; {
description = "Python bindings to Rust's persistent data structures (rpds";
homepage = "https://pypi.org/project/rpds-py/";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
});
};
packages = forAllSystems (system: {
inherit (nixpkgsFor.${system}) funkwhale;
inherit (nixpkgsFor.${system}) funkwhale-front;
});
defaultPackage = forAllSystems (system: self.packages.${system}.funkwhale);
# funkwhale service module
nixosModules.default = (import ./module.nix);
};
}