2021-05-01 23:38:12 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.ncspot;
|
|
|
|
|
|
|
|
tomlFormat = pkgs.formats.toml { };
|
|
|
|
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ maintainers.marsam ];
|
|
|
|
|
|
|
|
options.programs.ncspot = {
|
|
|
|
enable = mkEnableOption "ncspot";
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.ncspot;
|
2021-10-09 11:14:08 +02:00
|
|
|
defaultText = literalExpression "pkgs.ncspot";
|
2021-05-01 23:38:12 +02:00
|
|
|
description = "The package to use for ncspot.";
|
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
description = ''
|
|
|
|
Configuration written to
|
2021-12-09 04:02:00 +01:00
|
|
|
<filename>$XDG_CONFIG_HOME/ncspot/config.toml</filename>.
|
2021-05-01 23:38:12 +02:00
|
|
|
</para><para>
|
|
|
|
See <link xlink:href="https://github.com/hrkfdn/ncspot#configuration" />
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|