feat: use NUR HM module for AMRP

This commit is contained in:
winston 2023-06-04 01:51:55 +02:00
parent 0c928bdfed
commit 47abbffb1b
Signed by: winston
GPG key ID: 3786770EDBC2B481
3 changed files with 19 additions and 27 deletions

View file

@ -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": {

View file

@ -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 = {

View file

@ -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";
};
};
}