2021-07-02 22:36:30 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.ncspot;
|
|
|
|
|
|
|
|
tomlFormat = pkgs.formats.toml { };
|
|
|
|
|
|
|
|
in {
|
2023-08-08 10:19:01 +00:00
|
|
|
meta.maintainers = [ ];
|
2021-07-02 22:36:30 +00:00
|
|
|
|
|
|
|
options.programs.ncspot = {
|
|
|
|
enable = mkEnableOption "ncspot";
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.ncspot;
|
2021-11-04 16:42:44 +00:00
|
|
|
defaultText = literalExpression "pkgs.ncspot";
|
2021-07-02 22:36:30 +00:00
|
|
|
description = "The package to use for ncspot.";
|
|
|
|
};
|
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
type = tomlFormat.type;
|
|
|
|
default = { };
|
2021-11-04 16:42:44 +00:00
|
|
|
example = literalExpression ''
|
2021-07-02 22:36:30 +00:00
|
|
|
{
|
|
|
|
shuffle = true;
|
|
|
|
gapless = true;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
description = ''
|
|
|
|
Configuration written to
|
2023-08-08 10:19:01 +00:00
|
|
|
{file}`$XDG_CONFIG_HOME/ncspot/config.toml`.
|
|
|
|
|
|
|
|
See <https://github.com/hrkfdn/ncspot#configuration>
|
2021-07-02 22:36:30 +00:00
|
|
|
for the full list of options.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
|
|
|
xdg.configFile."ncspot/config.toml" = mkIf (cfg.settings != { }) {
|
|
|
|
source = tomlFormat.generate "ncspot-config" cfg.settings;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|