From 351b13c63acb86e74a77f7bdd96ba1df19bd2b12 Mon Sep 17 00:00:00 2001 From: MoritzBoehme Date: Tue, 12 Oct 2021 14:56:39 +0200 Subject: [PATCH] added spotifyd and spotify-tui --- modules/apps/default.nix | 4 +-- modules/apps/spotify.nix | 59 +++++++++++++++++++++++++++++++++++++ modules/services/agenix.nix | 4 +++ secrets/secrets.nix | 1 + secrets/spotify.age | 11 +++++++ 5 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 modules/apps/spotify.nix create mode 100644 secrets/spotify.age diff --git a/modules/apps/default.nix b/modules/apps/default.nix index 3582e0e..11bec03 100644 --- a/modules/apps/default.nix +++ b/modules/apps/default.nix @@ -1,12 +1,10 @@ { config, lib, pkgs, ... }: { - imports = [ ./rofi ./kitty.nix ./zathura.nix ./email.nix ]; + imports = [ ./rofi ./kitty.nix ./zathura.nix ./email.nix ./spotify.nix ]; home-manager.users.moritz.home.packages = with pkgs; [ neofetch unstable.keepassxc - unstable.spotify - spicetify-cli xfce.thunar xfce.xfconf xfce.tumbler diff --git a/modules/apps/spotify.nix b/modules/apps/spotify.nix new file mode 100644 index 0000000..60f450e --- /dev/null +++ b/modules/apps/spotify.nix @@ -0,0 +1,59 @@ +{ config, lib, pkgs, ... }: + +{ + home-manager.users.moritz = { + home.packages = with pkgs; [ spotify-tui ]; + services.spotifyd = { + enable = true; + settings = { + global = { + # A command that gets executed and can be used to + # retrieve your username. + username_cmd = "${pkgs.coreutils}/bin/head -n 1 /run/secrets/spotify"; + + # A command that gets executed and can be used to + # retrieve your password. + password_cmd = "${pkgs.coreutils}/bin/tail -n 1 /run/secrets/spotify"; + + # The name that gets displayed under the connect tab on + # official clients. Spaces are not allowed! + device_name = "spotifyd"; + + # The audio bitrate. 96, 160 or 320 kbit/s + bitrate = 320; + + # Volume on startup between 0 and 100 + initial_volume = "50"; + + # If set to true, enables volume normalisation between songs. + volume_normalisation = true; + + # The normalisation pregain that is applied for each song. + normalisation_pregain = -10; + }; + }; + }; + xdg.configFile."spotify-tui/config.yml".text = '' + # Dracula theme + theme: + active: "139,233,253" # current playing song in list + banner: "80,250,123" # the "spotify-tui" banner on launch + error_border: "241,250,140" # error dialog border + error_text: "248,248,242" # error message text (e.g. "Spotify API + # reported error 404") + hint: "241,250,140" # hint text in errors + hovered: "255,184,108" # hovered pane border + inactive: "248,248,242" # borders of inactive panes + playbar_background: "68,71,90" # background of progress bar + playbar_progress: "248,248,242" # filled-in part of the progress bar + playbar_progress_text: "248,248,242" # song length and time played/left + # indicator in the progress bar + playbar_text: "248,248,242" # artist name in player pane + selected: "80,250,123" # a) selected pane border, b) hovered item + # in list, & c) track title in player + text: "248,248,242" # text in panes + header: "248,248,242" # header text in panes (e.g. 'Title', + # 'Artist', etc.) + ''; + }; +} diff --git a/modules/services/agenix.nix b/modules/services/agenix.nix index 5d82bc8..bdab758 100644 --- a/modules/services/agenix.nix +++ b/modules/services/agenix.nix @@ -10,4 +10,8 @@ }; age.secrets.smbMoritz.file = ../../secrets/smbMoritz.age; age.secrets.smbMedia.file = ../../secrets/smbMedia.age; + age.secrets.spotify = { + file = ../../secrets/spotify.age; + owner = "1000"; + }; } diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 1987304..c544ced 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -13,4 +13,5 @@ in { "davfs.age".publicKeys = users ++ hosts; "smbMoritz.age".publicKeys = users ++ hosts; "smbMedia.age".publicKeys = users ++ hosts; + "spotify.age".publicKeys = users ++ hosts; } diff --git a/secrets/spotify.age b/secrets/spotify.age new file mode 100644 index 0000000..3bfe0d4 --- /dev/null +++ b/secrets/spotify.age @@ -0,0 +1,11 @@ +age-encryption.org/v1 +-> ssh-ed25519 ZYd7Zg uUN+f7PbKCN9x1oSFTJAUB1uD/YwmFJZ/Wni0H+vpVA +iMTkK8IdI/B0dD4AyDdpOIZOeCToMdZ4pJoVIcGvlew +-> ssh-ed25519 wG6LYg 48hS2aSBKxAPcJwDrGoKPqyVk3tEXzYDf4hXQJtaUiE +Lf0RMt0bqrzZ4AcSpcMZQx+ZVttbnlgyE8r9NZCvuxI +-> ssh-ed25519 CjuqfA Hh5nGDhjdy8p2LrK8CbAqiyrSeJxG1D/iOdpikeRaTM +bz5JfdI26LiQBp+jVS8ckXhK98fbUcY23nnCogE8wbA +-> c.-grease k2 .GE"g,r +LmQnZuZ305rgfcH8ryWOcQtu0dBwK64K8rKVIHPTdHSbmHR1vw +--- FmOY6KrOmNeecu8RifL6BRYmy7wK+ZbcG3mDV4HOpXc +{pV Z# ==~cz_(u81 b/ГI5\k',T ] \ No newline at end of file