From 2e547fbe9a6703fa9f831247250c5e9a1da0b811 Mon Sep 17 00:00:00 2001 From: sefidel Date: Wed, 5 Jan 2022 09:45:29 +0900 Subject: home/programs: add module 'spotify-tui' --- home/modules/programs/spotify-tui/default.nix | 56 +++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 home/modules/programs/spotify-tui/default.nix (limited to 'home/modules/programs') diff --git a/home/modules/programs/spotify-tui/default.nix b/home/modules/programs/spotify-tui/default.nix new file mode 100644 index 0000000..433ba64 --- /dev/null +++ b/home/modules/programs/spotify-tui/default.nix @@ -0,0 +1,56 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.programs.spotify-tui; + yamlFormat = pkgs.formats.yaml { }; + +in { + meta.maintainers = with lib.maintainers; [ boppyt ]; + + options.programs.spotify-tui = { + enable = mkEnableOption "A Spotify client for the terminal written in Rust."; + + package = mkOption { + type = types.package; + default = pkgs.spotify-tui; + defaultText = literalExpression "pkgs.spotify-tui"; + description = "The spotify-tui package to install"; + }; + + settings = mkOption { + type = yamlFormat.type; + default = { }; + description = '' + Configuration written to + $XDG_CONFIG_HOME/spotify-tui/config.yml. See + for a list of available options. + ''; + example = literalExpression '' + { + theme = { + active = "Cyan"; + banner = "LightCyan"; + }; + + behavior = { + seek_milliseconds = 5000; + volume_increment = 10; + }; + } + ''; + }; + }; + + config = mkIf cfg.enable { + + home.packages = [ cfg.package ]; + + xdg.configFile."spotify-tui/config.yml" = mkIf (cfg.settings != { }) { + source = yamlFormat.generate "config.yml" cfg.settings; + }; + }; +} -- cgit 1.4.1