initial commit

This commit is contained in:
Denis Lehmann 2021-04-25 02:06:26 +02:00
commit 8c91d525aa
5 changed files with 299 additions and 0 deletions

49
flake.nix Normal file
View file

@ -0,0 +1,49 @@
{
description = "Stream media over SSH.";
nixConfig.bash-prompt = "\[strm-develop\]$ ";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Use mpv with scripts
mpv = (pkgs.mpv-with-scripts.override {
scripts = [
pkgs.mpvScripts.mpris
];
});
in
{
# Package
packages.strm =
pkgs.stdenv.mkDerivation {
name = "strm";
src = self;
patchPhase = with pkgs; ''
substituteInPlace strm \
--replace mpv ${mpv}/bin/mpv \
'';
installPhase = ''
install -m 755 -D strm $out/bin/strm
'';
};
defaultPackage = self.packages.${system}.strm;
# Development shell
devShell = pkgs.mkShell {
buildInputs = [
mpv
];
};
}
);
}