diff --git a/configs/default.nix b/configs/default.nix index a3dfec0..350b135 100644 --- a/configs/default.nix +++ b/configs/default.nix @@ -40,6 +40,7 @@ in ./redshift.nix ./retiolum.nix ./rofi.nix + ./spotify.nix ./ssh.nix ./sudo.nix ./sxiv.nix diff --git a/configs/packages/default.nix b/configs/packages/default.nix index 0b6e731..038b739 100644 --- a/configs/packages/default.nix +++ b/configs/packages/default.nix @@ -102,7 +102,6 @@ in inkscape pdfgrep # search in pdf pdftk # pdf toolkit - spotify nur.repos.kmein.python3Packages.spotify-cli-linux youtubeDL bc # calculator diff --git a/configs/spotify.nix b/configs/spotify.nix new file mode 100644 index 0000000..5ef488e --- /dev/null +++ b/configs/spotify.nix @@ -0,0 +1,21 @@ +{ pkgs, lib, ... }: +let + inherit (import { inherit pkgs; }) toTOML; + inherit (lib.strings) fileContents; +in +{ + environment.systemPackages = with pkgs; [ + spotify + spotify-tui + ]; + + services.spotifyd = { + enable = true; + config = toTOML { + global = { + username = fileContents ; + password_cmd = "${pkgs.pass}/bin/pass shared/spotify/password"; + }; + }; + }; +} diff --git a/lib/default.nix b/lib/default.nix index 7941883..1ad2d60 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,7 +1,7 @@ { pkgs, ... }: -{ +rec { writeTOML = object: pkgs.runCommand "generated.toml" {} '' echo '${builtins.toJSON object}' | ${pkgs.remarshal}/bin/json2toml > $out ''; - toTOML = object: builtins.readFile (pkgs.writeTOML object); + toTOML = object: builtins.readFile (writeTOML object); }