chore: refactor code
This commit is contained in:
parent
be346e0e29
commit
829a8dab4e
2 changed files with 78 additions and 60 deletions
|
|
@ -1,15 +1,12 @@
|
||||||
{ lib, inputs, fetchFromGitHub, pkgs, stdenv, ... }:
|
{
|
||||||
let
|
lib,
|
||||||
erl = pkgs.beam.interpreters.erlang_28;
|
fetchFromGitHub,
|
||||||
erlangPackages = pkgs.beam.packagesWith erl;
|
pkgs,
|
||||||
|
stdenv,
|
||||||
elixir = erlangPackages.elixir;
|
...
|
||||||
mix = "${elixir}/bin/mix";
|
}: let
|
||||||
rebar = erlangPackages.rebar;
|
erlang = pkgs.beam.packagesWith pkgs.beam.interpreters.erlang;
|
||||||
hex = erlangPackages.hex;
|
mix = "${erlang.elixir}/bin/mix";
|
||||||
|
|
||||||
bun = pkgs.bun;
|
|
||||||
bun2nix = inputs.bun2nix.packages.${stdenv.hostPlatform.system}.default;
|
|
||||||
|
|
||||||
translatedPlatform =
|
translatedPlatform =
|
||||||
{
|
{
|
||||||
|
|
@ -19,8 +16,10 @@ let
|
||||||
x86_64-darwin = "macos-x64";
|
x86_64-darwin = "macos-x64";
|
||||||
x86_64-linux = "linux-x64";
|
x86_64-linux = "linux-x64";
|
||||||
}
|
}
|
||||||
.${stdenv.hostPlatform.system};
|
.${
|
||||||
|
stdenv.hostPlatform.system
|
||||||
|
};
|
||||||
|
|
||||||
version = "v0.6.0";
|
version = "v0.6.0";
|
||||||
pname = "mydia";
|
pname = "mydia";
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
|
|
@ -29,62 +28,73 @@ let
|
||||||
rev = version;
|
rev = version;
|
||||||
hash = "sha256-JGT52ulnqcx8o+3e0l50TLAwLIWXEI8nwFGUsA95vH0=";
|
hash = "sha256-JGT52ulnqcx8o+3e0l50TLAwLIWXEI8nwFGUsA95vH0=";
|
||||||
};
|
};
|
||||||
mixFodDeps = erlangPackages.fetchMixDeps {
|
mixFodDeps = erlang.fetchMixDeps {
|
||||||
inherit version src;
|
inherit version src;
|
||||||
pname = "mix-deps-${pname}";
|
pname = "mix-deps-${pname}-${version}";
|
||||||
hash = "sha256-19q56IZe8YjuUBXirFGgmBsewJ0cmdOoO1yfiMaWGWk=";
|
hash = "sha256-19q56IZe8YjuUBXirFGgmBsewJ0cmdOoO1yfiMaWGWk=";
|
||||||
|
|
||||||
|
DATABASE_TYPE = "postgres";
|
||||||
};
|
};
|
||||||
npmFodDeps= pkgs.fetchNpmDeps {
|
npmFodDeps = pkgs.fetchNpmDeps {
|
||||||
src = "${src}/assets";
|
src = "${src}/assets";
|
||||||
hash = "sha256-0cz75pxhxvzo1RogsV8gTP6GrgLIboWQXcKpq42JZ6o=";
|
hash = "sha256-0cz75pxhxvzo1RogsV8gTP6GrgLIboWQXcKpq42JZ6o=";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
erlangPackages.mixRelease {
|
erlang.mixRelease {
|
||||||
inherit pname version src mixFodDeps;
|
inherit pname version src mixFodDeps;
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
enableDebugInfo = true;
|
||||||
# ffmpeg_7
|
|
||||||
# pkg-config
|
|
||||||
# tailwindcss
|
|
||||||
];
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
ffmpeg_7
|
|
||||||
pkg-config
|
|
||||||
];
|
|
||||||
|
|
||||||
preInstall = ''
|
nativeBuildInputs = with pkgs; [
|
||||||
ln -s ${pkgs.tailwindcss}/bin/tailwind _build/tailwind-${translatedPlatform}
|
ffmpeg_6
|
||||||
ln -s ${pkgs.esbuild}/bin/esbuild _build/esbuild-${translatedPlatform}
|
fdk_aac
|
||||||
ln -s ${npmFodDeps} assets/node_modules
|
sqlite
|
||||||
|
postgresql
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
ffmpeg_6
|
||||||
|
fdk_aac
|
||||||
|
sqlite
|
||||||
|
postgresql
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
${mix} assets.deploy
|
DATABASE_TYPE = "postgres";
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
preInstall = ''
|
||||||
description = "Your personal media companion, built with Phoenix LiveView";
|
ln -s ${pkgs.tailwindcss}/bin/tailwind _build/tailwind-${translatedPlatform}
|
||||||
longDescription = ''
|
ln -s ${pkgs.esbuild}/bin/esbuild _build/esbuild-${translatedPlatform}
|
||||||
A modern, self-hosted media management platform for tracking, organizing, and monitoring your media library.
|
ln -s ${npmFodDeps} assets/node_modules
|
||||||
|
|
||||||
# ✨ Features
|
${mix} assets.deploy
|
||||||
|
|
||||||
- 📺 Unified Media Management – Track both movies and TV shows with rich metadata from TMDB/TVDB
|
|
||||||
- 🤖 Automated Downloads – Background search and download with quality profiles and smart release ranking
|
|
||||||
- ⬇️ Download Clients – qBittorrent, Transmission, SABnzbd, and NZBGet support
|
|
||||||
- 🔎 Indexer Integration – Search via Prowlarr and Jackett for finding releases
|
|
||||||
- 📚 Built-in Indexer Library – Native Cardigann support (experimental, limited testing)
|
|
||||||
- 👥 Multi-User System – Built-in admin/guest roles with request approval workflow
|
|
||||||
- 🔐 SSO Support – Local authentication plus OIDC/OpenID Connect integration
|
|
||||||
- 🔔 Release Calendar – Track upcoming releases and monitor episodes
|
|
||||||
- 🎨 Modern Real-Time UI – Phoenix LiveView with instant updates and responsive design
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
homepage = "https://github.com/getmydia/mydia";
|
meta = {
|
||||||
changelog = "https://github.com/getmydia/mydia/releases";
|
description = "Your personal media companion, built with Phoenix LiveView";
|
||||||
license = lib.licenses.agpl3Only;
|
longDescription = ''
|
||||||
|
A modern, self-hosted media management platform for tracking, organizing, and monitoring your media library.
|
||||||
|
|
||||||
maintainers = [];
|
# ✨ Features
|
||||||
|
|
||||||
platforms = lib.platforms.all;
|
- 📺 Unified Media Management – Track both movies and TV shows with rich metadata from TMDB/TVDB
|
||||||
mainProgram = pname;
|
- 🤖 Automated Downloads – Background search and download with quality profiles and smart release ranking
|
||||||
};
|
- ⬇️ Download Clients – qBittorrent, Transmission, SABnzbd, and NZBGet support
|
||||||
}
|
- 🔎 Indexer Integration – Search via Prowlarr and Jackett for finding releases
|
||||||
|
- 📚 Built-in Indexer Library – Native Cardigann support (experimental, limited testing)
|
||||||
|
- 👥 Multi-User System – Built-in admin/guest roles with request approval workflow
|
||||||
|
- 🔐 SSO Support – Local authentication plus OIDC/OpenID Connect integration
|
||||||
|
- 🔔 Release Calendar – Track upcoming releases and monitor episodes
|
||||||
|
- 🎨 Modern Real-Time UI – Phoenix LiveView with instant updates and responsive design
|
||||||
|
'';
|
||||||
|
|
||||||
|
homepage = "https://github.com/getmydia/mydia";
|
||||||
|
changelog = "https://github.com/getmydia/mydia/releases";
|
||||||
|
license = lib.licenses.agpl3Only;
|
||||||
|
|
||||||
|
maintainers = [];
|
||||||
|
|
||||||
|
platforms = lib.platforms.all;
|
||||||
|
mainProgram = pname;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
{ mkShell, inputs, pkgs, stdenv, ... }:
|
{
|
||||||
|
mkShell,
|
||||||
|
inputs,
|
||||||
|
pkgs,
|
||||||
|
stdenv,
|
||||||
|
...
|
||||||
|
}:
|
||||||
mkShell {
|
mkShell {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
bash
|
bash
|
||||||
|
|
@ -7,6 +12,9 @@ mkShell {
|
||||||
just
|
just
|
||||||
yq
|
yq
|
||||||
pwgen
|
pwgen
|
||||||
|
alejandra
|
||||||
|
nil
|
||||||
|
nixd
|
||||||
inputs.clan-core.packages.${stdenv.hostPlatform.system}.clan-cli
|
inputs.clan-core.packages.${stdenv.hostPlatform.system}.clan-cli
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue