BAPSicle/flake.nix

92 lines
2.4 KiB
Nix
Raw Permalink Normal View History

{
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
'';
};
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 {
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-04-01 00:34:47 +00:00
./patches/2-not-beta.patch
];
};
2024-04-01 00:16:39 +00:00
inherit webstudio;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
(python311.withPackages dependencies)
nodejs_20
yarn
ffmpeg_6-full
];
};
});
}