nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 bash,
3 bc,
4 coreutils,
5 fetchFromGitHub,
6 ffmpeg,
7 findutils,
8 gawk,
9 gnugrep,
10 gnused,
11 jq,
12 lame,
13 lib,
14 mediainfo,
15 mp4v2,
16 ncurses,
17 resholve,
18}:
19
20resholve.mkDerivation rec {
21 pname = "aaxtomp3";
22 version = "1.3";
23
24 src = fetchFromGitHub {
25 owner = "krumpetpirate";
26 repo = "aaxtomp3";
27 tag = "v${version}";
28 hash = "sha256-7a9ZVvobWH/gPxa3cFiPL+vlu8h1Dxtcq0trm3HzlQg=";
29 };
30
31 postPatch = ''
32 substituteInPlace AAXtoMP3 \
33 --replace 'AAXtoMP3' 'aaxtomp3'
34 substituteInPlace interactiveAAXtoMP3 \
35 --replace 'AAXtoMP3' 'aaxtomp3' \
36 --replace 'call="./aaxtomp3"' 'call="$AAXTOMP3"'
37 '';
38
39 installPhase = ''
40 install -Dm 755 AAXtoMP3 $out/bin/aaxtomp3
41 install -Dm 755 interactiveAAXtoMP3 $out/bin/interactiveaaxtomp3
42 '';
43
44 solutions.default = {
45 scripts = [
46 "bin/aaxtomp3"
47 "bin/interactiveaaxtomp3"
48 ];
49 interpreter = "${bash}/bin/bash";
50 inputs = [
51 bc
52 coreutils
53 ffmpeg
54 findutils
55 gawk
56 gnugrep
57 gnused
58 jq
59 lame
60 mediainfo
61 mp4v2
62 ncurses
63 ];
64 keep."$call" = true;
65 fix = {
66 "$AAXTOMP3" = [ "${placeholder "out"}/bin/aaxtomp3" ];
67 "$FIND" = [ "find" ];
68 "$GREP" = [ "grep" ];
69 "$SED" = [ "sed" ];
70 };
71 };
72
73 meta = {
74 description = "Convert Audible's .aax filetype to MP3, FLAC, M4A, or OPUS";
75 homepage = "https://krumpetpirate.github.io/AAXtoMP3";
76 license = lib.licenses.wtfpl;
77 maintainers = [ ];
78 };
79}