From f16b43df69ea9022bd21a635a3389d0a122644d1 Mon Sep 17 00:00:00 2001 From: Denis Lehmann Date: Wed, 14 Apr 2021 16:31:29 +0200 Subject: [PATCH] add flake --- flake.lock | 25 +++++++++++++++++++++++++ flake.nix | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..98646a3 --- /dev/null +++ b/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1618407731, + "narHash": "sha256-ks5XvRPDpt+CEiIAfqo0CxOzNQHdFiR7hRwGjVySzgk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "55ac7d4580c9ab67848c98cb9519317a1cc399c8", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1039dd0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "Play YouTube videos from the command line in a convenient way"; + + outputs = { self, nixpkgs }: { + + defaultPackage.x86_64-linux = + with import nixpkgs { system = "x86_64-linux"; }; + + stdenv.mkDerivation { + + name = "tyt"; + src = self; + + buildInputs = [ + jq + mpv + youtube-dl + ]; + + patchPhase = '' + substituteInPlace tyt \ + --replace jq ${jq}/bin/jq \ + --replace mpv ${mpv}/bin/mpv \ + --replace youtube-dl ${youtube-dl}/bin/youtube-dl + ''; + + installPhase = '' + install -m 755 -D tyt $out/bin/tyt + ''; + }; + + }; +}