diff --git a/default.nix b/default.nix index db2b4a0..36b22ac 100644 --- a/default.nix +++ b/default.nix @@ -8,14 +8,15 @@ { pkgs ? import {} }: +let + wsgiserver = pkgs.callPackage ./pkgs/python-modules/wsgiserver { buildPythonPackage = pkgs.python3Packages.buildPythonPackage; fetchPypi = pkgs.python3Packages.fetchPypi; }; +in { # The `lib`, `modules`, and `overlay` names are special lib = import ./lib { inherit pkgs; }; # functions modules = import ./modules; # NixOS modules overlays = import ./overlays; # nixpkgs overlays - wsgiserver = pkgs.callPackage ./pkgs/python-modules/wsgiserver { buildPythonPackage = pkgs.python3Packages.buildPythonPackage; fetchPypi = pkgs.python3Packages.fetchPypi; }; - colors = pkgs.callPackage ./pkgs/colors { }; rank_photos = pkgs.callPackage ./pkgs/rank_photos { }; @@ -30,7 +31,8 @@ plotbitrate = pkgs.callPackage ./pkgs/plotbitrate { }; mangohud = pkgs.callPackage ./pkgs/MangoHUD { }; - grav1 = pkgs.callPackage ./pkgs/grav1 { wsgiserver = wsgiserver; setuptools = pkgs.python3Packages.setuptools; }; + grav1 = pkgs.callPackage ./pkgs/grav1/server.nix { wsgiserver = wsgiserver; setuptools = pkgs.python3Packages.setuptools; }; + grav1c = pkgs.callPackage ./pkgs/grav1/client.nix { }; botamusique = pkgs.callPackage ./pkgs/botamusique { }; diff --git a/pkgs/grav1/client.nix b/pkgs/grav1/client.nix new file mode 100644 index 0000000..7bc08eb --- /dev/null +++ b/pkgs/grav1/client.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, python3, fetchFromGitHub, ffmpeg, libaom, libvpx, dav1d, makeWrapper }: + +let + pythonEnv = python3.withPackages (pythonPackages: with pythonPackages; [ + requests + ]); +in +stdenv.mkDerivation { + pname = "grav1c"; + version = "0.0.0-20200708"; + + src = fetchFromGitHub { + owner = "wwww-wwww"; + repo = "grav1"; + rev = "975e16d7fedc2d4f012c694cb5b1b0876c3cac01"; + sha256 = "11vingnczwy7wxrzp0hqij0jwwzbwjjd8l35wk2zps28npazaly3"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ pythonEnv ]; + + installPhase = '' + mkdir -p $out/bin + cp grav1c.py $out/bin/grav1c + chmod +x $out/bin/grav1c + + wrapProgram $out/bin/grav1c \ + --prefix PATH : ${lib.makeBinPath [ ffmpeg libaom libvpx (dav1d.override { withTools = true; }) ]} + ''; + +} diff --git a/pkgs/grav1/default.nix b/pkgs/grav1/server.nix similarity index 100% rename from pkgs/grav1/default.nix rename to pkgs/grav1/server.nix