MPD services configuration

This commit is contained in:
Curt Spark 2024-03-21 16:01:57 +00:00
parent d5b2c3984e
commit 9dbe998f0d
2 changed files with 51 additions and 2 deletions

View File

@ -131,7 +131,45 @@ in
ExecStart = "${script}";
};
Install = {
WantedBy = [ "multi-user.target" ];
WantedBy = [ "default.target" ];
};
};
# This service appears to have issues when system sleeps - restart service
systemd.user.services.mpd-discord-rpc-refresh = let
script = pkgs.writeShellScript "mpd-discord-rpc-refresh-script"
''
systemctl --user restart mpd-discord-rpc.service
'';
in
{
Unit = {
Description = "Refresh mpd--discord-rpc service on sleep/hibernate/login to resolve issues";
Before = [ "systemd-suspend.service" "systemd-hibernate.service" "systemd-hybrid-sleep.service" ];
};
Service = {
ExecStart = "${script}";
};
Install = {
WantedBy = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" "xdg-desktop-autostart.target" ];
};
};
systemd.user.services.mpd-discord-rpc-start = let
script = pkgs.writeShellScript "mpd-discord-rpc-start-script"
''
systemctl --user start mpd.service
'';
in
{
Unit = {
Description = "Start MPD on boot";
};
Service = {
ExecStart = "${script}";
};
Install = {
WantedBy = [ "default.target" ];
};
};

View File

@ -86,13 +86,24 @@
LXVST_PATH = makePluginPath "lxvst";
VST_PATH = makePluginPath "vst";
VST3_PATH = makePluginPath "vst3";
# Dotnet libicu not found fix
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = "1";
};
# NixOS Dynamic Libraries Fix
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
# Add any missing dynamic libraries for unpackaged programs
# here, NOT in environment.systemPackages
icu
];
# Emacs Config Init Service - For root user also
systemd.services.emacs-config-initialiser = {
description = "Initialises default emacs configuration if not available";
wantedBy = [ "multi-user.target" ];
path = [ pkgs.coreutils pkgs.git ];
path = with pkgs; [ coreutils git ];
enable = true;
serviceConfig = {
User = "root";