chore: refactor code
This commit is contained in:
parent
93ad4f17f3
commit
95520c14d1
2 changed files with 78 additions and 60 deletions
|
|
@ -1,15 +1,12 @@
|
|||
{ lib, inputs, fetchFromGitHub, pkgs, stdenv, ... }:
|
||||
let
|
||||
erl = pkgs.beam.interpreters.erlang_28;
|
||||
erlangPackages = pkgs.beam.packagesWith erl;
|
||||
|
||||
elixir = erlangPackages.elixir;
|
||||
mix = "${elixir}/bin/mix";
|
||||
rebar = erlangPackages.rebar;
|
||||
hex = erlangPackages.hex;
|
||||
|
||||
bun = pkgs.bun;
|
||||
bun2nix = inputs.bun2nix.packages.${stdenv.hostPlatform.system}.default;
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
pkgs,
|
||||
stdenv,
|
||||
...
|
||||
}: let
|
||||
erlang = pkgs.beam.packagesWith pkgs.beam.interpreters.erlang;
|
||||
mix = "${erlang.elixir}/bin/mix";
|
||||
|
||||
translatedPlatform =
|
||||
{
|
||||
|
|
@ -19,8 +16,10 @@ let
|
|||
x86_64-darwin = "macos-x64";
|
||||
x86_64-linux = "linux-x64";
|
||||
}
|
||||
.${stdenv.hostPlatform.system};
|
||||
|
||||
.${
|
||||
stdenv.hostPlatform.system
|
||||
};
|
||||
|
||||
version = "v0.6.0";
|
||||
pname = "mydia";
|
||||
src = fetchFromGitHub {
|
||||
|
|
@ -29,62 +28,73 @@ let
|
|||
rev = version;
|
||||
hash = "sha256-JGT52ulnqcx8o+3e0l50TLAwLIWXEI8nwFGUsA95vH0=";
|
||||
};
|
||||
mixFodDeps = erlangPackages.fetchMixDeps {
|
||||
mixFodDeps = erlang.fetchMixDeps {
|
||||
inherit version src;
|
||||
pname = "mix-deps-${pname}";
|
||||
pname = "mix-deps-${pname}-${version}";
|
||||
hash = "sha256-19q56IZe8YjuUBXirFGgmBsewJ0cmdOoO1yfiMaWGWk=";
|
||||
|
||||
DATABASE_TYPE = "postgres";
|
||||
};
|
||||
npmFodDeps= pkgs.fetchNpmDeps {
|
||||
npmFodDeps = pkgs.fetchNpmDeps {
|
||||
src = "${src}/assets";
|
||||
hash = "sha256-0cz75pxhxvzo1RogsV8gTP6GrgLIboWQXcKpq42JZ6o=";
|
||||
};
|
||||
in
|
||||
erlangPackages.mixRelease {
|
||||
inherit pname version src mixFodDeps;
|
||||
erlang.mixRelease {
|
||||
inherit pname version src mixFodDeps;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
# ffmpeg_7
|
||||
# pkg-config
|
||||
# tailwindcss
|
||||
];
|
||||
buildInputs = with pkgs; [
|
||||
ffmpeg_7
|
||||
pkg-config
|
||||
];
|
||||
enableDebugInfo = true;
|
||||
|
||||
preInstall = ''
|
||||
ln -s ${pkgs.tailwindcss}/bin/tailwind _build/tailwind-${translatedPlatform}
|
||||
ln -s ${pkgs.esbuild}/bin/esbuild _build/esbuild-${translatedPlatform}
|
||||
ln -s ${npmFodDeps} assets/node_modules
|
||||
nativeBuildInputs = with pkgs; [
|
||||
ffmpeg_6
|
||||
fdk_aac
|
||||
sqlite
|
||||
postgresql
|
||||
pkg-config
|
||||
];
|
||||
buildInputs = with pkgs; [
|
||||
ffmpeg_6
|
||||
fdk_aac
|
||||
sqlite
|
||||
postgresql
|
||||
pkg-config
|
||||
];
|
||||
|
||||
${mix} assets.deploy
|
||||
'';
|
||||
DATABASE_TYPE = "postgres";
|
||||
|
||||
meta = {
|
||||
description = "Your personal media companion, built with Phoenix LiveView";
|
||||
longDescription = ''
|
||||
A modern, self-hosted media management platform for tracking, organizing, and monitoring your media library.
|
||||
preInstall = ''
|
||||
ln -s ${pkgs.tailwindcss}/bin/tailwind _build/tailwind-${translatedPlatform}
|
||||
ln -s ${pkgs.esbuild}/bin/esbuild _build/esbuild-${translatedPlatform}
|
||||
ln -s ${npmFodDeps} assets/node_modules
|
||||
|
||||
# ✨ Features
|
||||
|
||||
- 📺 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
|
||||
${mix} assets.deploy
|
||||
'';
|
||||
|
||||
homepage = "https://github.com/getmydia/mydia";
|
||||
changelog = "https://github.com/getmydia/mydia/releases";
|
||||
license = lib.licenses.agpl3Only;
|
||||
meta = {
|
||||
description = "Your personal media companion, built with Phoenix LiveView";
|
||||
longDescription = ''
|
||||
A modern, self-hosted media management platform for tracking, organizing, and monitoring your media library.
|
||||
|
||||
maintainers = [];
|
||||
# ✨ Features
|
||||
|
||||
platforms = lib.platforms.all;
|
||||
mainProgram = pname;
|
||||
};
|
||||
}
|
||||
- 📺 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";
|
||||
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 {
|
||||
packages = with pkgs; [
|
||||
bash
|
||||
|
|
@ -7,6 +12,9 @@ mkShell {
|
|||
just
|
||||
yq
|
||||
pwgen
|
||||
alejandra
|
||||
nil
|
||||
nixd
|
||||
inputs.clan-core.packages.${stdenv.hostPlatform.system}.clan-cli
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue