fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{
2 addDriverRunpath,
3 allowedPatternsPath ? callPackage ./closure.nix { inherit allowedPatterns; },
4 allowedPatterns ? {
5 # This config is just an example.
6 # When the hook observes either of the following requiredSystemFeatures:
7 nvidia-gpu.onFeatures = [
8 "gpu"
9 "nvidia-gpu"
10 "opengl"
11 "cuda"
12 ];
13 # It exposes these paths in the sandbox:
14 nvidia-gpu.paths = [
15 addDriverRunpath.driverLink
16 "/dev/dri"
17 "/dev/nvidia*"
18 ];
19 nvidia-gpu.unsafeFollowSymlinks = true;
20 },
21 callPackage,
22 extraWrapperArgs ? [ ],
23 lib,
24 makeWrapper,
25 nix,
26 nixosTests,
27 python3Packages,
28}:
29
30let
31 attrs = fromTOML (builtins.readFile ./pyproject.toml);
32 pname = attrs.project.name;
33 inherit (attrs.project) version;
34in
35
36python3Packages.buildPythonApplication {
37 inherit pname version;
38 pyproject = true;
39
40 src = lib.cleanSource ./.;
41
42 nativeBuildInputs = [
43 makeWrapper
44 python3Packages.setuptools
45 ];
46
47 postFixup = ''
48 wrapProgram $out/bin/${pname} \
49 --add-flags "--patterns ${allowedPatternsPath}" \
50 --add-flags "--nix-exe ${lib.getExe nix}" \
51 ${builtins.concatStringsSep " " extraWrapperArgs}
52 '';
53
54 passthru = {
55 inherit allowedPatterns;
56 tests = {
57 inherit (nixosTests) nix-required-mounts;
58 };
59 };
60 meta = {
61 inherit (attrs.project) description;
62 homepage = attrs.project.urls.Homepage;
63 license = lib.licenses.mit;
64 mainProgram = attrs.project.name;
65 maintainers = with lib.maintainers; [ SomeoneSerge ];
66 };
67}