From 47abbffb1b8641dd678fbbbcbf168b97106bed59 Mon Sep 17 00:00:00 2001 From: winston Date: Sun, 4 Jun 2023 01:51:55 +0200 Subject: [PATCH] feat: use NUR HM module for AMRP --- flake.lock | 21 +++++++++++---------- flake.nix | 3 ++- home/apps/media.nix | 22 ++++++---------------- 3 files changed, 19 insertions(+), 27 deletions(-) diff --git a/flake.lock b/flake.lock index f337769..befb8db 100644 --- a/flake.lock +++ b/flake.lock @@ -5,16 +5,17 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1685379842, - "narHash": "sha256-DvrBhXNnxX01cW4yY5zfmj97h6LXhbX3FnHWbem+I3g=", - "owner": "caarlos0", - "repo": "nur", - "rev": "6860070645d27d87c702c52caec81f708b1202c9", + "lastModified": 1685836117, + "narHash": "sha256-Z1MECnYm0qznV7khdtDR2wnQgVsX/+gc716ztjtSRWU=", + "owner": "nekowinston", + "repo": "caarlos0-nur", + "rev": "7494c6ec1eb21b722ef0f131fa2afa0e80e0b81a", "type": "github" }, "original": { - "owner": "caarlos0", - "repo": "nur", + "owner": "nekowinston", + "ref": "feat/add-apple-music-discord-module", + "repo": "caarlos0-nur", "type": "github" } }, @@ -239,11 +240,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1624561540, - "narHash": "sha256-izJ2PYZMGMsSkg+e7c9A1x3t/yOLT+qzUM6WQsc2tqo=", + "lastModified": 1685677062, + "narHash": "sha256-zoHF7+HNwNwne2XEomphbdc4Y8tdWT16EUxUTXpOKpQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c6a049a3d32293b24c0f894a840872cf67fd7c11", + "rev": "95be94370d09f97f6af6a1df1eb9649b5260724e", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index de2db0a..737cf57 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,7 @@ # NUR nur.url = "github:nix-community/nur"; nekowinston-nur.url = "github:nekowinston/nur"; - caarlos0-nur.url = "github:caarlos0/nur"; + caarlos0-nur.url = "github:nekowinston/caarlos0-nur/feat/add-apple-music-discord-module"; sops.url = "github:Mic92/sops-nix"; nix-index-database.url = "github:Mic92/nix-index-database"; @@ -81,6 +81,7 @@ ./modules/hm inputs.nix-index-database.hmModules.nix-index inputs.sops.homeManagerModules.sops + inputs.caarlos0-nur.homeManagerModules.default ]; users.${username}.imports = [./home]; extraSpecialArgs = { diff --git a/home/apps/media.nix b/home/apps/media.nix index bc3c08b..f6063af 100644 --- a/home/apps/media.nix +++ b/home/apps/media.nix @@ -4,7 +4,7 @@ pkgs, ... }: let - inherit (pkgs.stdenv.hostPlatform) isLinux; + inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux; in { programs.mpv.enable = isLinux; xdg.mimeApps.defaultApplications = { @@ -37,10 +37,11 @@ in { }; }; - services = lib.mkIf isLinux { - mpd.enable = true; + services = { + discord-applemusic-rich-presence.enable = isDarwin; + mpd.enable = isLinux; mpd-discord-rpc = { - enable = true; + enable = isLinux; settings = { format = { state = "$artist"; @@ -51,7 +52,7 @@ in { }; }; }; - mpd-mpris.enable = true; + mpd-mpris.enable = isLinux; }; launchd.agents.mpd = { @@ -83,15 +84,4 @@ in { StandardOutPath = "${config.xdg.cacheHome}/mpd.log"; }; }; - - launchd.agents.discord-applemusic-rich-presence = { - enable = false; - config = { - ProgramArguments = ["${lib.getExe pkgs.nur.repos.caarlos0.discord-applemusic-rich-presence}"]; - KeepAlive = true; - RunAtLoad = true; - StandardErrorPath = "${config.xdg.cacheHome}/discord-applemusic-rich-presence.log"; - StandardOutPath = "${config.xdg.cacheHome}/discord-applemusic-rich-presence.log"; - }; - }; }