82 lines
2.3 KiB
Nix
82 lines
2.3 KiB
Nix
{
|
|
description = "A tool for organising a music library";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
utils.url = "github:numtide/flake-utils";
|
|
flake-compat = {
|
|
url = "github:edolstra/flake-compat";
|
|
flake = false;
|
|
};
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
utils,
|
|
...
|
|
}:
|
|
{
|
|
overlays.musicutil = final: prev: let
|
|
system = final.system;
|
|
pkgs = final.pkgs;
|
|
lib = pkgs.lib;
|
|
stdenv = pkgs.stdenv;
|
|
in {
|
|
musicutil = pkgs.rustPlatform.buildRustPackage rec {
|
|
pname = "musicutil";
|
|
version = "latest";
|
|
|
|
src = ./.;
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
|
|
buildFeatures = ["taglib_extractor"];
|
|
|
|
postFixup = ''
|
|
wrapProgram $out/bin/musicutil \
|
|
--set PATH ${lib.makeBinPath [
|
|
pkgs.ffmpeg
|
|
]}
|
|
'';
|
|
|
|
doCheck = false;
|
|
nativeBuildInputs = with pkgs; [stdenv pkgs.stdenv.cc rustPlatform.bindgenHook pkg-config rustc cargo makeWrapper];
|
|
buildInputs = with pkgs; [ffmpeg zlib taglib];
|
|
};
|
|
};
|
|
overlays.default = self.overlays.musicutil;
|
|
}
|
|
// utils.lib.eachSystem (utils.lib.defaultSystems) (system: let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [self.overlays.default];
|
|
};
|
|
in {
|
|
defaultPackage = self.packages."${system}".musicutil;
|
|
packages.musicutil = pkgs.musicutil;
|
|
|
|
apps = rec {
|
|
musicutil = {
|
|
type = "app";
|
|
program = "${self.defaultPackage.${system}}/bin/musicutil";
|
|
};
|
|
default = musicutil;
|
|
};
|
|
|
|
defaultApp = self.apps."${system}".musicutil;
|
|
|
|
devShell = pkgs.mkShell {
|
|
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
|
|
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
|
|
BINDGEN_EXTRA_CLANG_ARGS = with pkgs; ''
|
|
-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion clang}/include
|
|
-isystem ${llvmPackages.libclang.out}/lib/clang/${lib.getVersion clang}/include
|
|
-isystem ${glibc.dev}/include
|
|
'';
|
|
buildInputs = with pkgs; [rustPlatform.bindgenHook zlib taglib pkg-config rustc cargo clippy rust-analyzer rustfmt];
|
|
};
|
|
|
|
lib = pkgs.musicutil.lib;
|
|
});
|
|
}
|