From 333c8cd363b803e71f3c709c3d12b4606dedd1c9 Mon Sep 17 00:00:00 2001 From: Kayvan Sylvan Date: Fri, 19 Dec 2025 22:27:07 -0800 Subject: [PATCH] feat: Nix: bundle yt-dlp with fabric package + fabric-slim variant - rename original fabric package to fabricSlim - create fabric package as symlinkJoin of fabricSlim and yt-dlp - add fabric-slim output for the slim variant - update default package to point to bundled fabric - enhance fabric meta description to note yt-dlp inclusion - set mainProgram to fabric in bundled package --- cmd/generate_changelog/incoming/1890.txt | 7 ++++++ flake.nix | 27 ++++++++++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 cmd/generate_changelog/incoming/1890.txt diff --git a/cmd/generate_changelog/incoming/1890.txt b/cmd/generate_changelog/incoming/1890.txt new file mode 100644 index 00000000..a1f3046c --- /dev/null +++ b/cmd/generate_changelog/incoming/1890.txt @@ -0,0 +1,7 @@ +### PR [#1890](https://github.com/danielmiessler/Fabric/pull/1890) by [ksylvan](https://github.com/ksylvan): Bundle yt-dlp with fabric in Nix flake, introduce slim variant + +- Added yt-dlp bundling with fabric package and introduced fabric-slim variant +- Renamed original fabric package to fabricSlim and created new fabric package as symlinkJoin of fabricSlim and yt-dlp +- Added fabric-slim output for the slim variant and updated default package to point to bundled fabric +- Enhanced fabric meta description to note yt-dlp inclusion and set mainProgram to fabric in bundled package +- Added wrapper for fabric binary to include PATH in execution environment diff --git a/flake.nix b/flake.nix index cbf9b26c..7526065f 100644 --- a/flake.nix +++ b/flake.nix @@ -73,14 +73,33 @@ let pkgs = nixpkgs.legacyPackages.${system}; goVersion = getGoVersion system; - in - { - default = self.packages.${system}.fabric; - fabric = pkgs.callPackage ./nix/pkgs/fabric { + fabricSlim = pkgs.callPackage ./nix/pkgs/fabric { go = goVersion; inherit self; inherit (gomod2nix.legacyPackages.${system}) buildGoApplication; }; + fabric = pkgs.symlinkJoin { + name = "fabric-${fabricSlim.version}"; + inherit (fabricSlim) version; + paths = [ + fabricSlim + pkgs.yt-dlp + ]; + nativeBuildInputs = [ pkgs.makeWrapper ]; + postBuild = '' + wrapProgram $out/bin/fabric \ + --prefix PATH : $out/bin + ''; + meta = fabricSlim.meta // { + description = "${fabricSlim.meta.description} (includes yt-dlp)"; + mainProgram = "fabric"; + }; + }; + in + { + default = fabric; + inherit fabric; + "fabric-slim" = fabricSlim; inherit (gomod2nix.legacyPackages.${system}) gomod2nix; } );