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; } );