Skip to content

Commit

Permalink
mpv-discord: init
Browse files Browse the repository at this point in the history
  • Loading branch information
bddvlpr committed Jan 16, 2024
1 parent 5611747 commit f3a44ea
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 3 deletions.
1 change: 1 addition & 0 deletions homes/common/applications/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
./graphics/blender.nix
./graphics/cura.nix
./graphics/unity.nix
./media/mpv.nix
./media/obs.nix
./media/spotify.nix
./productivity/freecad.nix
Expand Down
3 changes: 1 addition & 2 deletions homes/common/applications/entertainment/r2modman.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{pkgs, ...}: {
home = {
# TODO: https://github.com/NixOS/nixpkgs/pull/273455
# packages = with pkgs; [r2modman];
packages = with pkgs; [r2modman];

persistence."/nix/persist/home/bddvlpr".directories = [".config/r2modman" ".config/r2modmanPlus-local"];
};
Expand Down
7 changes: 7 additions & 0 deletions homes/common/applications/media/mpv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{pkgs, ...}: {
home.packages = [
(pkgs.mpv.override {
scripts = [pkgs.mpv-discord];
})
];
}
1 change: 0 additions & 1 deletion homes/common/desktop/wayland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
packages = with pkgs; [
grim
imv
mpv
mimeo
waypipe
slurp
Expand Down
1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
geist-mono = pkgs.callPackage ./fonts/geist-mono.nix {};
geist-nf = pkgs.callPackage ./fonts/geist-nf.nix {};
proton-ge-custom = pkgs.callPackage ./entertainment/proton-ge-custom.nix {};
mpv-discord = pkgs.callPackage ./media/mpv-discord.nix {};
}
36 changes: 36 additions & 0 deletions pkgs/media/mpv-discord.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
buildGoModule,
fetchFromGitHub,
stdenv,
...
}: let
name = "mpv-discord";
version = "1.4.1";

src = fetchFromGitHub {
owner = "tnychn";
repo = name;
rev = "v${version}";
hash = "sha256-Uvm4McZR88s9tsstqLz7O2F3KkqsGlGrDoL8RjgQnVI=";
};

core = buildGoModule {
name = "${name}-core";
inherit version;
src = "${src}/mpv-discord";

vendorHash = "sha256-xe1jyWFQUD+Z4qBAVQ0SBY0gdxmi5XG9t29n3f/WKDs=";
};
in
stdenv.mkDerivation rec {
inherit name version src;

scriptName = "discord.lua";

installPhase = ''
mkdir -p $out/share/mpv/scripts/
cp -rv $src/scripts/discord.lua $out/share/mpv/scripts/${scriptName}
substituteInPlace $out/share/mpv/scripts/${scriptName} --replace 'binary_path = ""' 'binary_path = "${core}/bin/mpv-discord"'
'';
}

0 comments on commit f3a44ea

Please sign in to comment.