pkgs: init mpvScripts under applications/video

This commit is contained in:
raf 2024-03-18 16:55:45 +03:00
parent d52fa53348
commit 557e694c0e
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
3 changed files with 34 additions and 9 deletions

View file

@ -0,0 +1,16 @@
{
lib,
mpvScripts,
}:
mpvScripts.buildLua {
pname = "save-history";
version = "unstable-2024-03-18";
src = builtins.filterSource (path: type: type != "directory" || (!lib.hasSuffix path ".nix")) ./.;
meta = {
description = "Save history of played files";
homepage = "https://github.com/notashelf/nyxpkgs";
maintainers = [lib.maintainers.NotAShelf];
};
}

View file

@ -0,0 +1,12 @@
local HISTFILE = (os.getenv('XDG_DATA_HOME') or os.getenv('HOME')) .. '/mpv/history.log';
mp.register_event('file-loaded', function()
local title, fp;
title = mp.get_property('media-title');
title = (title == mp.get_property('filename') and "" or (' (%s)'):format(title));
fp = io.open(HISTFILE, 'a+');
fp:write(('[%s] %s%s\n'):format(os.date('%Y-%m-%d %X'), mp.get_property('path'), title));
fp:close();
end)

View file

@ -4,21 +4,18 @@
callPackage,
...
}: {
/*
packages that follow npins entries
they can be updated via npins
*/
# packages that follow npins entries
# they can be updated via npins
ani-cli = mkPackage ./applications/misc/ani-cli;
rat = mkPackage ./applications/misc/rat;
rofi-calc-wayland = mkPackage ./applications/misc/rofi-calc-wayland;
rofi-emoji-wayland = mkPackage ./applications/misc/rofi-emoji-wayland;
/*
static packages
need manual intervention with each update
*/
mov-cli = callPackage ./applications/misc/mov-cli {};
# static packages
# need manual intervention with each update
cloneit = callPackage ./applications/misc/cloneit {};
mov-cli = callPackage ./applications/misc/mov-cli {};
mpv-history = callPackage ./applications/video/mpv/scripts/save-history {};
mastodon-bird-ui = callPackage ./applications/social/mastodon-bird-ui {};
headscale-ui = callPackage ./applications/networking/headscale-ui {};
reposilite-bin = callPackage ./applications/networking/reposilite-bin {