|
1 | | -# usage: `nix develop --command zsh` |
2 | 1 | { |
3 | 2 | description = "MTFG"; |
4 | 3 |
|
5 | 4 | inputs = { |
6 | | - nixpkgs = { |
7 | | - url = "github:NixOS/nixpkgs/nixos-22.05"; |
8 | | - }; |
9 | | - flake-utils = { |
10 | | - url = "github:numtide/flake-utils"; |
11 | | - }; |
| 5 | + nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05"; |
12 | 6 | }; |
13 | 7 |
|
14 | | - outputs = { self, nixpkgs, flake-utils }: |
15 | | - flake-utils.lib.eachDefaultSystem |
16 | | - (system: |
17 | | - let pkgs = nixpkgs.legacyPackages.${system}; in |
18 | | - { |
19 | | - devShells.default = import ./shell.nix { inherit pkgs; }; |
20 | | - } |
21 | | - ); |
| 8 | + outputs = { self, nixpkgs, ... }: |
| 9 | + let |
| 10 | + system = "x86_64-linux"; |
| 11 | + pkgs = import nixpkgs { |
| 12 | + system = "${system}"; |
| 13 | + }; |
| 14 | + mtfgDependencies = with pkgs; [ |
| 15 | + qt5.qtbase |
| 16 | + qt5.full |
| 17 | + qt5.wrapQtAppsHook |
| 18 | + libsForQt5.breeze-qt5 |
| 19 | + libsForQt5.qt5ct |
| 20 | + customPythonPackages.pkgs.opencv4 |
| 21 | + customPythonPackages.pkgs.simplification |
| 22 | + (python39.withPackages (p: with p; [ |
| 23 | + coloredlogs |
| 24 | + cryptography |
| 25 | + matplotlib |
| 26 | + mpv |
| 27 | + pillow |
| 28 | + pip |
| 29 | + playsound |
| 30 | + pynput |
| 31 | + pyqt5 |
| 32 | + pyqtgraph |
| 33 | + pyyaml |
| 34 | + scipy |
| 35 | + screeninfo |
| 36 | + ])) |
| 37 | + ]; |
| 38 | + libPath = pkgs.lib.makeLibraryPath mtfgDependencies; |
| 39 | + binPath = pkgs.lib.makeBinPath mtfgDependencies; |
| 40 | + |
| 41 | + customPythonPackages = |
| 42 | + let |
| 43 | + packageOverrides = self: |
| 44 | + super: { |
| 45 | + opencv4 = super.opencv4.overrideAttrs (old: rec { |
| 46 | + buildInputs = old.buildInputs ++ [ pkgs.qt5.full ]; |
| 47 | + cmakeFlags = old.cmakeFlags ++ [ "-DWITH_QT=ON" ]; |
| 48 | + }); |
| 49 | + |
| 50 | + simplification = pkgs.python39Packages.buildPythonPackage rec { |
| 51 | + pname = "simplification"; |
| 52 | + version = "0.6.2"; |
| 53 | + format = "wheel"; |
| 54 | + |
| 55 | + src = pkgs.fetchurl { |
| 56 | + url = "https://files.pythonhosted.org/packages/02/3e/829b59a5d072feb45e14879d3149a2dad743a18f83db29d8f3800a33aa64/simplification-0.6.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"; |
| 57 | + sha256 = "20fb00f219bdd33319fc7526d23ef1fb7e52a40027a010f1013dd60626282325"; |
| 58 | + }; |
| 59 | + |
| 60 | + doCheck = false; |
| 61 | + }; |
| 62 | + }; |
| 63 | + in |
| 64 | + pkgs.python39.override { inherit packageOverrides; self = customPythonPackages; }; |
| 65 | + in |
| 66 | + { |
| 67 | + packages.${system}.mtfg = pkgs.stdenv.mkDerivation { |
| 68 | + pname = "MTFG"; |
| 69 | + version = "0.5.3"; |
| 70 | + src = pkgs.fetchgit { |
| 71 | + url = "https://github.com/michael-mueller-git/Python-Funscript-Editor.git"; |
| 72 | + rev = "7cb898de9fec72c7e7b0ce2c3f25ad52f1d3a24e"; |
| 73 | + sha256 = "sha256-SMHaGIMkoVdc2gENR1ILV/H+BZ7yHB4yxcpVxJaY9oo="; |
| 74 | + }; |
| 75 | + buildInputs = mtfgDependencies; |
| 76 | + QT_QPA_PLATFORM = "xcb"; |
| 77 | + }; |
| 78 | + defaultPackage.${system} = self.packages.x86_64-linux.mtfg; |
| 79 | + formatter.${system} = pkgs.nixpkgs-fmt; |
| 80 | + devShells.${system}.default = pkgs.mkShell { |
| 81 | + buildInputs = mtfgDependencies; |
| 82 | + shellHook = '' |
| 83 | + # use xwayland not wayland |
| 84 | + export QT_QPA_PLATFORM="xcb" |
| 85 | + ''; |
| 86 | + }; |
| 87 | + }; |
22 | 88 | } |
0 commit comments