diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..83794a2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,77 @@ +{ + "nodes": { + "crane": { + "locked": { + "lastModified": 1734808813, + "narHash": "sha256-3aH/0Y6ajIlfy7j52FGZ+s4icVX0oHhqBzRdlOeztqg=", + "owner": "ipetkov", + "repo": "crane", + "rev": "72e2d02dbac80c8c86bf6bf3e785536acf8ee926", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1735915915, + "narHash": "sha256-Q4HuFAvoKAIiTRZTUxJ0ZXeTC7lLfC9/dggGHNXNlCw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a27871180d30ebee8aa6b11bf7fef8a52f024733", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "crane": "crane", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..97054f6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "Projects packaged by 4o1x5"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + crane.url = "github:ipetkov/crane"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + self, + nixpkgs, + crane, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + craneLib = crane.mkLib pkgs; + in + { + packages = { + jellyfin-tui = import ./packages/jellyfin-tui.nix { + inherit pkgs craneLib; + }; + }; + + apps = { + jellyfin-tui = { + type = "app"; + program = "${self.packages.${system}.jellyfin-tui}/bin/jellyfin-tui"; + }; + }; + } + ); +} diff --git a/packages/jellyfin-tui.nix b/packages/jellyfin-tui.nix new file mode 100644 index 0000000..c03ee56 --- /dev/null +++ b/packages/jellyfin-tui.nix @@ -0,0 +1,35 @@ +{ pkgs, craneLib }: +let + commonArgs = { + src = pkgs.fetchFromGitHub { + owner = "dhonus"; + repo = "jellyfin-tui"; + rev = "200657d421dd4cfb605f8417778c0c58d97dd1f9"; + hash = "sha256-Tcc4e8oz2OZfdO9iNvU+TjJlct2IB5iJ3u2usf9D7iY="; + }; + strictDeps = true; + LIBCCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; + + nativeBuildInputs = with pkgs; [ + openssl + pkg-config + ]; + buildInputs = + with pkgs; + [ + mpv + perl + openssl + pkg-config + ] + ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ + pkgs.libiconv + ]; + }; +in +craneLib.buildPackage ( + commonArgs + // { + cargoArtifacts = craneLib.buildDepsOnly commonArgs; + } +)