Skip to content

Commit

Permalink
run on multiple systems
Browse files Browse the repository at this point in the history
  • Loading branch information
libewa committed Jun 16, 2024
1 parent 3d8d184 commit 542b696
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 24 deletions.
34 changes: 34 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 31 additions & 24 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,39 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flakeutils = {
url = "github:numtide/flake-utils";
};
};

outputs = { self, nixpkgs }: {
apps.x86_64-linux.default = {
type = "app";
program = "${self.defaultPackage.x86_64-linux}/bin/makevideo.sh";
};
outputs = { self, nixpkgs, flakeutils }:
flakeutils.lib.eachSystem ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" "i686-linux"] (system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
apps.default = {
type = "app";
program = "${self.defaultPackage.${system}}/bin/makevideo.sh";
};

defaultPackage.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.stdenv.mkDerivation {
name = "makevideo";
src = ./.;
buildInputs = with nixpkgs.legacyPackages.x86_64-linux; [
bash
ffmpeg
yt-dlp
];
defaultPackage = pkgs.stdenv.mkDerivation {
name = "makevideo";
src = ./.;
buildInputs = with pkgs; [
bash
ffmpeg
yt-dlp
];

nativeBuildInputs = with nixpkgs.legacyPackages.x86_64-linux; [
makeWrapper
];
installPhase = ''
mkdir -p $out/bin
cp makevideo.sh $out/bin/
wrapProgram $out/bin/makevideo.sh \
--prefix PATH : "${nixpkgs.legacyPackages.x86_64-linux.lib.makeBinPath [ nixpkgs.legacyPackages.x86_64-linux.ffmpeg nixpkgs.legacyPackages.x86_64-linux.yt-dlp]}"
'';
};
};
nativeBuildInputs = with pkgs; [
makeWrapper
];
installPhase = ''
mkdir -p $out/bin
cp makevideo.sh $out/bin/
wrapProgram $out/bin/makevideo.sh \
--prefix PATH : "${pkgs.lib.makeBinPath [ pkgs.ffmpeg pkgs.yt-dlp]}"
'';
};
}
);
}

0 comments on commit 542b696

Please sign in to comment.