chore: refactor code

This commit is contained in:
Chris Kruining 2025-11-27 11:05:35 +01:00 committed by chris
parent 93ad4f17f3
commit 95520c14d1
2 changed files with 78 additions and 60 deletions

View file

@ -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,7 +16,9 @@ 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";
@ -29,28 +28,39 @@ 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;
enableDebugInfo = true;
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
# ffmpeg_7 ffmpeg_6
# pkg-config fdk_aac
# tailwindcss sqlite
]; postgresql
buildInputs = with pkgs; [
ffmpeg_7
pkg-config pkg-config
]; ];
buildInputs = with pkgs; [
ffmpeg_6
fdk_aac
sqlite
postgresql
pkg-config
];
DATABASE_TYPE = "postgres";
preInstall = '' preInstall = ''
ln -s ${pkgs.tailwindcss}/bin/tailwind _build/tailwind-${translatedPlatform} ln -s ${pkgs.tailwindcss}/bin/tailwind _build/tailwind-${translatedPlatform}

View file

@ -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
]; ];
} }