video download helper, fooyin, etc

This commit is contained in:
Danilo Reyes 2024-05-25 20:40:21 -06:00
parent f71472a1ff
commit d3c7401438
10 changed files with 239 additions and 19 deletions

17
flake.lock generated
View File

@ -37,6 +37,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-master": {
"locked": {
"lastModified": 1715996989,
"narHash": "sha256-ObD9YSelkwCAylEXJHcNjrn3hLOfIVScB1tPz9zeDN8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "63d3e5d82edf5a138e7d0872231cc23ed4e740fd",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1714253743, "lastModified": 1714253743,
@ -57,6 +73,7 @@
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-master": "nixpkgs-master",
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable"
} }
} }

View File

@ -4,11 +4,13 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-23.11"; nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-23.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs?ref=master";
home-manager.url = "github:nix-community/home-manager/release-23.11"; home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }@inputs: outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-master, home-manager, ...
}@inputs:
let let
inherit (self) outputs; inherit (self) outputs;
lib = nixpkgs.lib // home-manager.lib; lib = nixpkgs.lib // home-manager.lib;
@ -20,6 +22,7 @@
}; };
pkgs = makePkgs nixpkgs; pkgs = makePkgs nixpkgs;
pkgsU = makePkgs nixpkgs-unstable; pkgsU = makePkgs nixpkgs-unstable;
pkgsM = makePkgs nixpkgs-master;
in { in {
inherit lib pkgs; inherit lib pkgs;
formatter = pkgs.alejandra; formatter = pkgs.alejandra;
@ -36,6 +39,7 @@
nautilus = gPrev.nautilus.overrideAttrs (nsuper: { nautilus = gPrev.nautilus.overrideAttrs (nsuper: {
buildInputs = nsuper.buildInputs buildInputs = nsuper.buildInputs
++ (with pkgs.gst_all_1; [ ++ (with pkgs.gst_all_1; [
gst-libav
gst-plugins-good gst-plugins-good
gst-plugins-bad gst-plugins-bad
gst-plugins-ugly gst-plugins-ugly
@ -52,9 +56,6 @@
}; };
}); });
}); });
planify = pkgsU.planify;
gdtoolkit = pkgsU.gdtoolkit;
gallery-dl = pkgsU.gallery-dl;
lutris = super.lutris.override { lutris = super.lutris.override {
extraPkgs = pkgs: [ extraPkgs = pkgs: [
pkgs.winetricks pkgs.winetricks
@ -65,6 +66,11 @@
nerdfonts = super.nerdfonts.override { nerdfonts = super.nerdfonts.override {
fonts = [ "CascadiaCode" "ComicShannsMono" "Iosevka" ]; fonts = [ "CascadiaCode" "ComicShannsMono" "Iosevka" ];
}; };
fooyin = pkgsM.fooyin;
planify = pkgsU.planify;
gdtoolkit = pkgsU.gdtoolkit;
gallery-dl = pkgsU.gallery-dl;
ns-usbloader = pkgsU.ns-usbloader;
handbrake = super.handbrake.override { useGtk = true; }; handbrake = super.handbrake.override { useGtk = true; };
discord = super.discord.override { withOpenASAR = true; }; discord = super.discord.override { withOpenASAR = true; };
ripgrep = super.ripgrep.override { withPCRE2 = true; }; ripgrep = super.ripgrep.override { withPCRE2 = true; };

View File

@ -2,7 +2,6 @@
{ {
services = { services = {
tumbler.enable = true;
gvfs.enable = true; gvfs.enable = true;
xserver = { xserver = {
enable = true; enable = true;
@ -26,7 +25,7 @@
# gnome-shell-extensions # gnome-shell-extensions
baobab baobab
]) ++ (with pkgs.gnome; [ ]) ++ (with pkgs.gnome; [
totem # totem
gnome-music gnome-music
epiphany epiphany
gnome-characters gnome-characters
@ -40,7 +39,8 @@
}; };
users.users.jawz.packages = with pkgs; users.users.jawz.packages = with pkgs;
([ ([
adw-gtk3 # ffmpegthumbnailer # generate thumbnails
adw-gtk3 # theme legacy applications
gnome.gnome-tweaks # tweaks for the gnome desktop environment gnome.gnome-tweaks # tweaks for the gnome desktop environment
(papirus-icon-theme.override { color = "adwaita"; }) (papirus-icon-theme.override { color = "adwaita"; })
# gradience # theme customizer, allows you to modify adw-gtk3 themes # gradience # theme customizer, allows you to modify adw-gtk3 themes

View File

@ -4,6 +4,7 @@ let
(builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") { (builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") {
config = config.nixpkgs.config; config = config.nixpkgs.config;
}; };
vdhcoapp = pkgs.callPackage ../../pkgs/vdhcoapp/default.nix { };
in { in {
imports = [ imports = [
# <agenix/modules/age.nix> # <agenix/modules/age.nix>
@ -12,7 +13,10 @@ in {
../../gnome.nix ../../gnome.nix
./obs-studio.nix ./obs-studio.nix
]; ];
programs.obs-studio = { enable = true; }; programs.obs-studio = {
enable = true;
enableVirtualCamera = true;
};
my = { my = {
emacs.enable = true; emacs.enable = true;
apps = { apps = {
@ -99,6 +103,8 @@ in {
groups.nixremote.gid = 555; groups.nixremote.gid = 555;
users = { users = {
jawz.packages = (with pkgs; [ jawz.packages = (with pkgs; [
fooyin
vdhcoapp
gocryptfs # encrypted filesystem! shhh!!! gocryptfs # encrypted filesystem! shhh!!!
torrenttools # create torrent files from the terminal! torrenttools # create torrent files from the terminal!
vcsi # video thumbnails for torrents, can I replace it with ^? vcsi # video thumbnails for torrents, can I replace it with ^?
@ -150,4 +156,15 @@ in {
httpListenAddr = "0.0.0.0"; httpListenAddr = "0.0.0.0";
directoryRoot = "/resilio"; directoryRoot = "/resilio";
}; };
virtualisation = {
podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
};
};
} }

View File

@ -48,10 +48,10 @@
device = "/dev/disk/by-uuid/e9618e85-a631-4374-b2a4-22c376d6e41b"; device = "/dev/disk/by-uuid/e9618e85-a631-4374-b2a4-22c376d6e41b";
preLVM = true; preLVM = true;
}; };
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; # extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
extraModprobeConfig = '' # extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 # options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
''; # '';
initrd = { initrd = {
availableKernelModules = availableKernelModules =
[ "xhci_pci" "ahci" "usbhid" "nvme" "usb_storage" "sd_mod" ]; [ "xhci_pci" "ahci" "usbhid" "nvme" "usb_storage" "sd_mod" ];
@ -60,11 +60,11 @@
}; };
fileSystems = let fileSystems = let
nfsMount = nfsDisk: { nfsMount = (server: nfsDisk: {
device = "miniserver:/${nfsDisk}"; device = "${server}:/${nfsDisk}";
fsType = "nfs"; fsType = "nfs";
options = [ "x-systemd.automount" "noauto" "x-systemd.idle-timeout=600" ]; options = [ "x-systemd.automount" "noauto" "x-systemd.idle-timeout=600" ];
}; });
btrfsMount = subvol: { btrfsMount = subvol: {
device = "/dev/mapper/nvme"; device = "/dev/mapper/nvme";
fsType = "btrfs"; fsType = "btrfs";
@ -82,9 +82,11 @@
"/" = btrfsMount "nixos" // { }; "/" = btrfsMount "nixos" // { };
"/home" = btrfsMount "home" // { }; "/home" = btrfsMount "home" // { };
"/mnt/games" = btrfsMount "games" // { }; "/mnt/games" = btrfsMount "games" // { };
"/mnt/pool" = nfsMount "pool" // { }; "/mnt/miniserver/pool" = nfsMount "miniserver" "pool" // { };
"/mnt/jawz" = nfsMount "jawz" // { }; "/mnt/miniserver/jawz" = nfsMount "miniserver" "jawz" // { };
# "/mnt/btrfs" = nfsMount "btrfs" // { }; # "/mnt/server/pool" = nfsMount "server" "pool" // { };
# "/mnt/server/jawz" = nfsMount "server" "jawz" // { };
# "/mnt/miniserver/btrfs" = nfsMount "btrfs" // { };
"/boot" = { "/boot" = {
device = "/dev/disk/by-uuid/ac6d349a-96b9-499e-9009-229efd7743a5"; device = "/dev/disk/by-uuid/ac6d349a-96b9-499e-9009-229efd7743a5";
fsType = "ext4"; fsType = "ext4";

View File

@ -19,7 +19,7 @@
protonup-qt # update proton-ge protonup-qt # update proton-ge
# grapejuice # roblox manager # grapejuice # roblox manager
# minecraft # minecraft official launcher # minecraft # minecraft official launcher
# ns-usbloader # load games into my switch ns-usbloader # load games into my switch
# emulators # emulators
rpcs3 # ps3 emulator rpcs3 # ps3 emulator

45
pkgs/fooyin/default.nix Normal file
View File

@ -0,0 +1,45 @@
{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, alsa-lib, ffmpeg, kdePackages
, kdsingleapplication, openssl, pipewire, taglib, zlib }:
stdenv.mkDerivation (finalAttrs: {
pname = "fooyin";
version = "0.4.2";
src = fetchFromGitHub {
owner = "ludouzi";
repo = "fooyin";
rev = "v" + finalAttrs.version;
hash = "sha256-1U7eqXVcp0lO/X92oNQ3mWdozgJ1eroQPojscSWH6+I=";
};
buildInputs = [
alsa-lib
ffmpeg
kdsingleapplication
pipewire
kdePackages.qcoro
kdePackages.qtbase
kdePackages.qtsvg
taglib
];
nativeBuildInputs =
[ cmake pkg-config kdePackages.qttools kdePackages.wrapQtAppsHook ];
cmakeFlags = [
(lib.cmakeBool "BUILD_TESTING" (finalAttrs.doCheck or false))
# we need INSTALL_FHS to be true as the various artifacts are otherwise just dumped in the root
# of $out and the fixupPhase cleans things up anyway
(lib.cmakeBool "INSTALL_FHS" true)
];
env.LANG = "C.UTF-8";
meta = with lib; {
description = "A customisable music player";
mainProgram = "fooyin";
license = licenses.gpl3Only;
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.all;
};
})

46
pkgs/vdhcoapp/code.patch Normal file
View File

@ -0,0 +1,46 @@
diff --git a/src/converter.js b/src/converter.js
index af7b4c3..20da407 100644
--- a/src/converter.js
+++ b/src/converter.js
@@ -1,4 +1,4 @@
-import open from 'open';
+function open() {}
const os = require("os");
const path = require('path');
@@ -9,9 +9,9 @@ const rpc = require('./weh-rpc');
const exec_dir = path.dirname(process.execPath);
-const ffmpeg = findExecutableFullPath("ffmpeg", exec_dir);
-const ffprobe = findExecutableFullPath("ffprobe", exec_dir);
-const filepicker = findExecutableFullPath("filepicker", exec_dir);
+const ffmpeg = "@ffmpeg@/bin/ffmpeg";
+const ffprobe = "@ffmpeg@/bin/ffprobe";
+const filepicker = "@filepicker@";
if (!fileExistsSync(ffmpeg)) {
logger.error("ffmpeg not found. Install ffmpeg and make sure it's in your path.");
diff --git a/src/main.js b/src/main.js
index 47b92de..e2e9402 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,4 +1,4 @@
-const config = require('config.json');
+const config = require('./config.json');
const converter = require('./converter');
const os = require("os");
diff --git a/src/native-autoinstall.js b/src/native-autoinstall.js
index 556a22b..c729568 100644
--- a/src/native-autoinstall.js
+++ b/src/native-autoinstall.js
@@ -1,7 +1,7 @@
const os = require("os");
const path = require("path");
const { spawn, exec } = require('child_process');
-const config = require('config.json');
+const config = require('./config.json');
let fs;
if (process.versions.node.startsWith("10")) {

60
pkgs/vdhcoapp/default.nix Normal file
View File

@ -0,0 +1,60 @@
{ lib, fetchFromGitHub, buildNpmPackage, toml2json, nodejs, ffmpeg
, substituteAll, makeWrapper, callPackage }:
# This is an adaptation with buildNpmPackage based on https://github.com/milahu/nur-packages/commit/3022ffb3619182ffcd579194e1202e3978e4d55b
let filepicker = callPackage ./filepicker.nix { };
in buildNpmPackage rec {
pname = "vdhcoapp";
version = "2.0.19";
src = fetchFromGitHub {
owner = "aclap-dev";
repo = "vdhcoapp";
rev = "v${version}";
hash = "sha256-8xeZvqpRq71aShVogiwlVD3gQoPGseNOmz5E3KbsZxU=";
};
sourceRoot = "${src.name}/app";
npmDepsHash = "sha256-E032U2XZdyTER6ROkBosOTn7bweDXHl8voC3BQEz8Wg=";
dontNpmBuild = true;
nativeBuildInputs = [ toml2json makeWrapper ];
patches = [
(substituteAll {
src = ./code.patch;
inherit ffmpeg;
filepicker = lib.getExe filepicker;
})
];
postPatch = ''
# Cannot use patch, setting placeholder here
substituteInPlace src/native-autoinstall.js \
--replace process.execPath "\"${placeholder "out"}/bin/vdhcoapp\""
'';
preBuild = ''
toml2json --pretty ../config.toml > src/config.json
'';
installPhase = ''
mkdir -p $out/opt/vdhcoapp
cp -r . "$out/opt/vdhcoapp"
makeWrapper ${nodejs}/bin/node $out/bin/vdhcoapp \
--add-flags $out/opt/vdhcoapp/src/main.js
'';
meta = with lib; {
description =
"Companion application for the Video DownloadHelper browser add-on";
homepage = "https://www.downloadhelper.net/";
license = licenses.gpl2;
maintainers = with maintainers; [ wolfangaukang ];
mainProgram = "vdhcoapp";
};
}

View File

@ -0,0 +1,27 @@
{ lib, rustPlatform, fetchFromGitHub, pkg-config, atk, gtk3, glib }:
rustPlatform.buildRustPackage rec {
pname = "filepicker";
version = "1.0.1";
src = fetchFromGitHub {
owner = "paulrouget";
repo = "static-filepicker";
rev = "v${version}";
hash = "sha256-7sRzf3SA9RSBf4O36olXgka8c6Bufdb0qsuTofVe55s=";
};
cargoHash = "sha256-aal7ppFkCpNc+QTS4Qklsb9WfJ65QqG6p1eOskiX+/Q=";
buildInputs = [ atk gtk3 glib ];
nativeBuildInputs = [ pkg-config ];
meta = with lib; {
description = "File picker used by VDHCoApp";
homepage = "https://github.com/paulrouget/static-filepicker";
license = licenses.gpl2;
mainProgram = "filepicker";
maintainers = with maintainers; [ hannesgith ];
};
}