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
This commit is contained in:
Kayvan Sylvan
2025-12-19 22:27:07 -08:00
parent 294a4635de
commit 333c8cd363
2 changed files with 30 additions and 4 deletions

View File

@@ -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

View File

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