ctucx.git: nixfiles

ctucx' nixfiles

commit 728faca3c66dc701ccd36309c80601ad31b481c8
parent 3ac17a4b6baa3c5db680c871db233c889da7236d
Author: Leah (ctucx) <leah@ctu.cx>
Date: Thu, 27 Jan 2022 14:29:57 +0100

services/spotifyd: use age-secrets
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/configurations/services/spotifyd.nix b/configurations/services/spotifyd.nix
@@ -1,19 +1,31 @@
-{ pkgs, ... }:
+{ config, pkgs, ... }:
 
 let
   secrets = import ../../secrets;
 
 in {
+
   networking.firewall.allowedUDPPorts = [ 57621 ];
   networking.firewall.allowedTCPPorts = [ 33903 57621 ];
 
+  age.secrets = {
+    spotify-username = {
+      file  = ../../secrets/spotify/username.age;
+      owner = "leah";
+    };
+    spotify-password = {
+      file  = ../../secrets/spotify/password.age;
+      owner = "leah";
+    };
+  };
+
   home-manager.users.leah = {
     services.spotifyd = {
       enable   = true;
       settings = {
         global = {
-          username       = secrets.spotifyd.username;
-          password       = secrets.spotifyd.password;
+          username_cmd   = "${pkgs.coreutils}/bin/cat ${config.age.secrets.spotify-username.path}";
+          password_cmd   = "${pkgs.coreutils}/bin/cat ${config.age.secrets.spotify-password.path}";
 
           use_mpris      = true;
           backend        = "pulseaudio";