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