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" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1685379842, "lastModified": 1685836117,
"narHash": "sha256-DvrBhXNnxX01cW4yY5zfmj97h6LXhbX3FnHWbem+I3g=", "narHash": "sha256-Z1MECnYm0qznV7khdtDR2wnQgVsX/+gc716ztjtSRWU=",
"owner": "caarlos0", "owner": "nekowinston",
"repo": "nur", "repo": "caarlos0-nur",
"rev": "6860070645d27d87c702c52caec81f708b1202c9", "rev": "7494c6ec1eb21b722ef0f131fa2afa0e80e0b81a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "caarlos0", "owner": "nekowinston",
"repo": "nur", "ref": "feat/add-apple-music-discord-module",
"repo": "caarlos0-nur",
"type": "github" "type": "github"
} }
}, },
@ -239,11 +240,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1624561540, "lastModified": 1685677062,
"narHash": "sha256-izJ2PYZMGMsSkg+e7c9A1x3t/yOLT+qzUM6WQsc2tqo=", "narHash": "sha256-zoHF7+HNwNwne2XEomphbdc4Y8tdWT16EUxUTXpOKpQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c6a049a3d32293b24c0f894a840872cf67fd7c11", "rev": "95be94370d09f97f6af6a1df1eb9649b5260724e",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -15,7 +15,7 @@
# NUR # NUR
nur.url = "github:nix-community/nur"; nur.url = "github:nix-community/nur";
nekowinston-nur.url = "github:nekowinston/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"; sops.url = "github:Mic92/sops-nix";
nix-index-database.url = "github:Mic92/nix-index-database"; nix-index-database.url = "github:Mic92/nix-index-database";
@ -81,6 +81,7 @@
./modules/hm ./modules/hm
inputs.nix-index-database.hmModules.nix-index inputs.nix-index-database.hmModules.nix-index
inputs.sops.homeManagerModules.sops inputs.sops.homeManagerModules.sops
inputs.caarlos0-nur.homeManagerModules.default
]; ];
users.${username}.imports = [./home]; users.${username}.imports = [./home];
extraSpecialArgs = { extraSpecialArgs = {

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (pkgs.stdenv.hostPlatform) isLinux; inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux;
in { in {
programs.mpv.enable = isLinux; programs.mpv.enable = isLinux;
xdg.mimeApps.defaultApplications = { xdg.mimeApps.defaultApplications = {
@ -37,10 +37,11 @@ in {
}; };
}; };
services = lib.mkIf isLinux { services = {
mpd.enable = true; discord-applemusic-rich-presence.enable = isDarwin;
mpd.enable = isLinux;
mpd-discord-rpc = { mpd-discord-rpc = {
enable = true; enable = isLinux;
settings = { settings = {
format = { format = {
state = "$artist"; state = "$artist";
@ -51,7 +52,7 @@ in {
}; };
}; };
}; };
mpd-mpris.enable = true; mpd-mpris.enable = isLinux;
}; };
launchd.agents.mpd = { launchd.agents.mpd = {
@ -83,15 +84,4 @@ in {
StandardOutPath = "${config.xdg.cacheHome}/mpd.log"; 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";
};
};
} }