-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
73 lines (70 loc) · 2.48 KB
/
flake.nix
File metadata and controls
73 lines (70 loc) · 2.48 KB
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
{
description = "funscript-copilot";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
};
outputs = { self, nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
system = "${system}";
};
dependencies = [
(pkgs.python310.withPackages (p: with p; [
customPythonPackages.pkgs.opencv4
customPythonPackages.pkgs.coloredlogs
customPythonPackages.pkgs.cryptography
customPythonPackages.pkgs.matplotlib
customPythonPackages.pkgs.pip
customPythonPackages.pkgs.pyyaml
customPythonPackages.pkgs.scipy
customPythonPackages.pkgs.websockets
customPythonPackages.pkgs.GitPython
customPythonPackages.pkgs.onnxruntime
customPythonPackages.pkgs.filterpy
customPythonPackages.pkgs.pandas
customPythonPackages.pkgs.pynput
customPythonPackages.pkgs.scikit-learn
]))
];
libPath = pkgs.lib.makeLibraryPath dependencies;
binPath = pkgs.lib.makeBinPath dependencies;
customPythonPackages =
let
packageOverrides = self:
super: {
opencv4 = super.opencv4.overrideAttrs (old: rec {
buildInputs = old.buildInputs ++ [ pkgs.qt6.full ];
cmakeFlags = old.cmakeFlags ++ [ "-DWITH_QT=ON" ];
});
};
in
pkgs.python310.override { inherit packageOverrides; self = customPythonPackages; };
in
{
packages.${system}.funscript-copilot = pkgs.python310Packages.buildPythonPackage {
pname = "funscript-copilot";
version = "0.0.3";
src = pkgs.fetchFromGitHub {
owner = "michael-mueller-git";
repo = "funscript-copilot";
rev = "574fcaa660e14a0be57c734aec7e17c0e13e10ea";
# NOTE: change hash to refresh
sha256 = "sha256-0ZVJUCaVGwtUoTVujYQPfM9XLHgJQucKn/NCuoZtefI=";
fetchSubmodules = true;
};
propagatedBuildInputs = dependencies;
nativeBuildInputs = with pkgs; [
makeWrapper
];
postInstall = ''
wrapProgram "$out/bin/funscript-copilot" --prefix LD_LIBRARY_PATH : "${libPath}" --prefix PATH : "${binPath}"
'';
};
defaultPackage.${system} = self.packages.x86_64-linux.funscript-copilot;
formatter.${system} = pkgs.nixpkgs-fmt;
devShells.${system}.default = pkgs.mkShell {
buildInputs = dependencies;
};
};
}