1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-03-09 18:30:02 +01:00

feat: finish YouTube downloading; primitive "raw" archiving

This commit is contained in:
TheGeneralist 2025-10-15 00:29:08 +02:00
commit 01cc7826bf
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
9 changed files with 1059 additions and 0 deletions

77
flake.nix Normal file
View file

@ -0,0 +1,77 @@
{
description = "Archivr - An open-source archive manager";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs =
{ nixpkgs, ... }:
let
lib = nixpkgs.lib;
systems = [
"x86_64-linux"
"aarch64-darwin"
];
in
{
packages = lib.genAttrs systems (
system:
let
pkgs = import nixpkgs { inherit system; };
archivr_unwrapped = pkgs.rustPlatform.buildRustPackage {
pname = "archivr";
version = "0.1.0";
src = pkgs.lib.cleanSource ./.;
cargoHash = "sha256-y47+Fmp3BID86aPnLtrvzg40lOr9cHyg/38+onisK7w=";
nativeBuildInputs = [ pkgs.pkg-config ];
};
archivr = pkgs.stdenv.mkDerivation {
pname = "archivr-wrapped";
version = "0.1.0";
nativeBuildInputs = [ pkgs.makeWrapper ];
buildInputs = [
pkgs.yt-dlp
];
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
cp -r ${archivr_unwrapped}/bin/* $out/bin/
for f in $out/bin/*; do
mv "$f" "$f.orig"
makeWrapper "$f.orig" "$f" \
--set ARCHIVR_YT_DLP ${pkgs.yt-dlp}/bin/yt-dlp \
--prefix PATH : ${
lib.makeBinPath [
pkgs.yt-dlp
]
}
done
'';
};
in
{
archivr = archivr;
archivr-unwrapped = archivr_unwrapped;
}
);
devShells = lib.genAttrs systems (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
default = pkgs.mkShell {
buildInputs = [
pkgs.yt-dlp
pkgs.nushell
];
shellHook = ''
export SHELL=${pkgs.nushell}/bin/nu
echo "nushell dev shell active yt-dlp on PATH"
nu
'';
};
}
);
};
}