Skyler Grey | b78a7e4 | 2022-09-01 23:55:59 +0100 | [diff] [blame] | 1 | { |
| 2 | pkgs, |
| 3 | config, |
| 4 | home, |
| 5 | username, |
| 6 | ... |
| 7 | }: { |
| 8 | home.services.spotifyd = { |
| 9 | enable = true; |
| 10 | settings = { |
| 11 | global = { |
| 12 | username_cmd = "${pkgs.coreutils}/bin/cat ${config.sops.secrets.spotifyUsername.path}"; |
| 13 | password_cmd = "${pkgs.coreutils}/bin/cat ${config.sops.secrets.spotifyPassword.path}"; |
| 14 | use_mpris = true; |
| 15 | device_name = "background@${config.networking.hostName}"; |
| 16 | cache_path = "${home.home.homeDirectory}/.cache/spotifyd"; |
| 17 | max_cache_size = 1000000000; |
| 18 | volume_normalisation = true; |
| 19 | normalisation_pregain = -10; |
| 20 | autoplay = true; |
| 21 | zeroconf_port = 1234; |
| 22 | device_type = "computer"; |
| 23 | }; |
| 24 | }; |
| 25 | }; |
| 26 | config = { |
| 27 | sops.secrets.spotifyUsername = { |
| 28 | mode = "0400"; |
| 29 | owner = config.users.users.${username}.name; |
| 30 | group = config.users.users.nobody.group; |
| 31 | }; |
| 32 | sops.secrets.spotifyPassword = { |
| 33 | mode = "0400"; |
| 34 | owner = config.users.users.${username}.name; |
| 35 | group = config.users.users.nobody.group; |
| 36 | }; |
| 37 | environment.persistence."/nix/persist".users.${username}.directories = [".cache/spotifyd"]; |
| 38 | }; |
| 39 | } |