2021-05-01 23:38:12 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.ncspot;
|
|
|
|
|
|
|
|
tomlFormat = pkgs.formats.toml { };
|
|
|
|
|
|
|
|
in {
|
2023-06-22 10:16:28 +02:00
|
|
|
meta.maintainers = [ ];
|
2021-05-01 23:38:12 +02:00
|
|
|
|
|
|
|
options.programs.ncspot = {
|
2023-07-01 01:30:13 +02:00
|
|
|
enable = mkEnableOption (lib.mdDoc "ncspot");
|
2021-05-01 23:38:12 +02:00
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.ncspot;
|
2021-10-09 11:14:08 +02:00
|
|
|
defaultText = literalExpression "pkgs.ncspot";
|
2023-07-01 01:30:13 +02:00
|
|
|
description = lib.mdDoc "The package to use for ncspot.";
|
2021-05-01 23:38:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
type = tomlFormat.type;
|
|
|
|
default = { };
|
2021-10-09 11:14:08 +02:00
|
|
|
example = literalExpression ''
|
2021-05-01 23:38:12 +02:00
|
|
|
{
|
|
|
|
shuffle = true;
|
|
|
|
gapless = true;
|
|
|
|
}
|
|
|
|
'';
|
2023-07-01 01:30:13 +02:00
|
|
|
description = lib.mdDoc ''
|
2021-05-01 23:38:12 +02:00
|
|
|
Configuration written to
|
2023-07-01 01:30:13 +02:00
|
|
|
{file}`$XDG_CONFIG_HOME/ncspot/config.toml`.
|
|
|
|
|
|
|
|
See <https://github.com/hrkfdn/ncspot#configuration>
|
2021-05-01 23:38:12 +02: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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|