aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authoruonr <dev@yuru.me>2025-10-12 23:44:33 +0900
committermistivia <i@mistivia.com>2025-10-12 23:19:49 +0800
commit6b904d8172816f0be22e9188d85b2d59cb60d076 (patch)
tree94039a3d25c8f39e497d70094a5326b92461adfa /flake.nix
parent4121cd0f571990a06714ef5175de783088a71d99 (diff)
nix flake
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix79
1 files changed, 79 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..ba3000c
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,79 @@
+{
+ description = "EZLive: Self-hosted Serverless Livestream";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ };
+
+ outputs = { self, nixpkgs, flake-utils }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+ in
+ {
+ packages.default = pkgs.stdenv.mkDerivation {
+ pname = "ezlive";
+ version = "0.1.0";
+
+ src = ./.;
+
+ nativeBuildInputs = with pkgs; [
+ pkg-config
+ ];
+
+ buildInputs = with pkgs; [
+ ffmpeg
+ aws-sdk-cpp
+ ];
+
+ makeFlags = [
+ "CC=${pkgs.stdenv.cc}/bin/cc"
+ "CXX=${pkgs.stdenv.cc}/bin/c++"
+ ];
+
+ installPhase = ''
+ runHook preInstall
+ mkdir -p $out/bin
+ cp ezlive $out/bin/
+ runHook postInstall
+ '';
+
+ meta = with pkgs.lib; {
+ description = "Self-hosted Serverless Livestream built on top of S3-compatible object storage";
+ homepage = "https://github.com/mistivia/ezlive";
+ license = licenses.agpl3Only;
+ maintainers = [ ];
+ platforms = platforms.linux;
+ };
+ };
+
+ devShells.default = pkgs.mkShell {
+ buildInputs = with pkgs; [
+ gcc
+ gnumake
+ pkg-config
+ ffmpeg
+ aws-sdk-cpp
+ ];
+
+ shellHook = ''
+ echo "EZLive development environment"
+ echo "Run 'make' to build the project"
+ '';
+ };
+
+ packages.docker = pkgs.dockerTools.buildLayeredImage {
+ name = "ezlive";
+ tag = "latest";
+
+ contents = [ self.packages.${system}.default ];
+
+ config = {
+ Cmd = [ "${self.packages.${system}.default}/bin/ezlive" ];
+ WorkingDir = "/app";
+ };
+ };
+ }
+ );
+}