mirror of
https://github.com/kmein/niveum
synced 2026-03-21 04:11:07 +01:00
chore: nixfmt
This commit is contained in:
@@ -2,29 +2,25 @@
|
||||
let
|
||||
inherit (import <niveum/lib> { inherit pkgs; }) toTOML;
|
||||
inherit (lib.strings) fileContents;
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
spotify
|
||||
spotify-tui
|
||||
playerctl
|
||||
];
|
||||
in {
|
||||
environment.systemPackages = with pkgs; [ spotify spotify-tui playerctl ];
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/audio/spotifyd.nix
|
||||
systemd.user.services.spotifyd =
|
||||
let
|
||||
systemd.user.services.spotifyd = let
|
||||
spotifyd = pkgs.unstable.spotifyd.override {
|
||||
withMpris = true;
|
||||
withPulseAudio = true;
|
||||
inherit (pkgs) libpulseaudio dbus;
|
||||
};
|
||||
spotifydConf = pkgs.writeText "spotifyd.conf" (lib.generators.toINI {} {
|
||||
spotifydConf = pkgs.writeText "spotifyd.conf" (lib.generators.toINI { } {
|
||||
global = {
|
||||
username = fileContents <shared-secrets/spotify/username>;
|
||||
password = fileContents <shared-secrets/spotify/password>;
|
||||
backend = "pulseaudio";
|
||||
on_song_change_hook = toString (pkgs.writers.writeDash "songinfo" ''
|
||||
PATH=$PATH:${lib.makeBinPath [pkgs.playerctl pkgs.gawk pkgs.libnotify]}
|
||||
PATH=$PATH:${
|
||||
lib.makeBinPath [ pkgs.playerctl pkgs.gawk pkgs.libnotify ]
|
||||
}
|
||||
metadata=$(playerctl metadata --player spotifyd)
|
||||
title=$(echo "$metadata" | awk '/^xesam:title\s/ { print substr($0, index($0, $3)) }')
|
||||
artist=$(echo "$metadata" | awk '/^xesam:artist\s/ { print substr($0, index($0, $3)) }' | paste --serial --delimiters "/")
|
||||
@@ -38,7 +34,8 @@ in
|
||||
after = [ "network-online.target" "sound.target" ];
|
||||
description = "spotifyd, a Spotify playing daemon";
|
||||
serviceConfig = {
|
||||
ExecStart = "${spotifyd}/bin/spotifyd --no-daemon --config-path ${spotifydConf}";
|
||||
ExecStart =
|
||||
"${spotifyd}/bin/spotifyd --no-daemon --config-path ${spotifydConf}";
|
||||
Restart = "always";
|
||||
RestartSec = 12;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user