# yt - A fully featured command line YouTube client # # Copyright (C) 2024 Benedikt Peetz # SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Yt. # # You should have received a copy of the License along with this program. # If not, see . { description = "yt"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small"; treefmt-nix = { url = "github:numtide/treefmt-nix"; inputs = { nixpkgs.follows = "nixpkgs"; }; }; }; outputs = { self, nixpkgs, treefmt-nix, }: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages."${system}"; buildInputs = with pkgs; [ mpv-unwrapped.dev libffi openssl ]; nativeBuildInputs = with pkgs; [ llvmPackages_latest.clang-unwrapped.lib pkg-config # Needed for the tests in `libmpv2` SDL2 ]; yt = pkgs.callPackage ./package/package.nix {inherit tree-sitter-yts;}; tree-sitter-yts = pkgs.callPackage ./tree-sitter-yts/package.nix {}; treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;}; in { packages."${system}" = { inherit yt tree-sitter-yts; default = self.packages.${system}.yt; }; checks."${system}" = { inherit yt; formatting = treefmtEval.config.build.check self; }; formatter."${system}" = treefmtEval.config.build.wrapper; devShells."${system}".default = pkgs.mkShell { env = let clang_version = pkgs.lib.versions.major pkgs.llvmPackages_latest.clang-unwrapped.version; in { FFMPEG_LOCATION = "${pkgs.lib.getExe pkgs.ffmpeg}"; LIBCLANG_PATH = "${pkgs.llvmPackages_latest.clang-unwrapped.lib}/lib/libclang.so"; LIBCLANG_INCLUDE_PATH = "${pkgs.llvmPackages_latest.clang-unwrapped.lib}/lib/clang/${clang_version}/include"; C_INCLUDE_PATH = "${pkgs.glibc.dev}/include"; }; inherit buildInputs nativeBuildInputs; packages = [ # rust stuff pkgs.cargo pkgs.clippy pkgs.rustc pkgs.rustfmt pkgs.mold-wrapped pkgs.cargo-edit pkgs.cargo-expand pkgs.cargo-flamegraph # Releng pkgs.git-bug pkgs.reuse pkgs.cocogitto # Perf pkgs.hyperfine # Sqlite pkgs.sqlx-cli pkgs.sqlite-interactive # yt_dlp pkgs.yt-dlp pkgs.python3Packages.yt-dlp pkgs.python3 pkgs.jq pkgs.ffmpeg # Tree-sitter pkgs.nodejs pkgs.tree-sitter ]; }; }; }