2024-03-31 22:16:34 +00:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable;
|
|
|
|
flake-utils.url = github:numtide/flake-utils;
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
};
|
|
|
|
sanic-cors = import ./sanic-cors.nix {
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
inherit (pkgs.python311Packages) setuptools packaging sanic buildPythonPackage fetchPypi;
|
|
|
|
};
|
2024-04-01 00:16:39 +00:00
|
|
|
webstudio = import ./webstudio.nix {
|
|
|
|
inherit pkgs;
|
|
|
|
};
|
2024-04-01 00:30:28 +00:00
|
|
|
ui-templates = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "baps-ui-templates";
|
|
|
|
src = ./ui-templates;
|
|
|
|
phases = "installPhase";
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R $src/. $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
ui-static = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "baps-ui-static";
|
|
|
|
src = ./ui-static;
|
|
|
|
phases = "installPhase";
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R $src/. $out
|
|
|
|
'';
|
|
|
|
};
|
2024-03-31 22:16:34 +00:00
|
|
|
dependencies = ps: with ps; [
|
|
|
|
setuptools
|
|
|
|
wheel
|
|
|
|
sanic
|
|
|
|
sanic-cors
|
|
|
|
pygame
|
|
|
|
syncer
|
|
|
|
aiohttp
|
|
|
|
mutagen
|
|
|
|
sounddevice
|
|
|
|
setproctitle
|
|
|
|
pyttsx3
|
|
|
|
websockets
|
|
|
|
pyserial
|
|
|
|
requests
|
|
|
|
jinja2
|
|
|
|
pydub
|
|
|
|
psutil
|
|
|
|
];
|
|
|
|
version = self.shortRev or self.dirtyShortRev or "dirty-inputs";
|
|
|
|
in
|
|
|
|
{
|
2024-04-01 00:16:39 +00:00
|
|
|
packages = rec {
|
2024-03-31 22:16:34 +00:00
|
|
|
default = pkgs.python311Packages.buildPythonApplication {
|
|
|
|
pname = "bapsicle";
|
|
|
|
inherit version;
|
|
|
|
doCheck = false;
|
|
|
|
propagatedBuildInputs = dependencies pkgs.python311Packages;
|
|
|
|
src = ./.;
|
|
|
|
patches = [
|
|
|
|
./patches/0-setup.py-fixes.patch
|
2024-04-01 00:16:39 +00:00
|
|
|
(pkgs.substituteAll {
|
|
|
|
src = ./patches/1-presenter-build-path.patch;
|
|
|
|
baps_presenter = "${webstudio}";
|
2024-04-01 00:30:28 +00:00
|
|
|
ui_static = "${ui-static}";
|
|
|
|
ui_templates = "${ui-templates}";
|
2024-04-01 00:16:39 +00:00
|
|
|
})
|
2024-03-31 22:16:34 +00:00
|
|
|
];
|
|
|
|
};
|
2024-04-01 00:16:39 +00:00
|
|
|
|
|
|
|
inherit webstudio;
|
2024-03-31 22:16:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
(python311.withPackages dependencies)
|
|
|
|
nodejs_20
|
|
|
|
yarn
|
|
|
|
ffmpeg_6-full
|
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|