mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
Some files don't need nesting and can be root level again to reduce conflicts with other PRs. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
48 lines
1,016 B
Nix
48 lines
1,016 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib) mkIf;
|
|
|
|
cfg = config.programs.ncspot;
|
|
|
|
tomlFormat = pkgs.formats.toml { };
|
|
in
|
|
{
|
|
meta.maintainers = [ lib.maintainers.awwpotato ];
|
|
|
|
options.programs.ncspot = {
|
|
enable = lib.mkEnableOption "ncspot";
|
|
|
|
package = lib.mkPackageOption pkgs "ncspot" { nullable = true; };
|
|
|
|
settings = lib.mkOption {
|
|
type = tomlFormat.type;
|
|
default = { };
|
|
example = lib.literalExpression ''
|
|
{
|
|
shuffle = true;
|
|
gapless = true;
|
|
}
|
|
'';
|
|
description = ''
|
|
Configuration written to
|
|
{file}`$XDG_CONFIG_HOME/ncspot/config.toml`.
|
|
|
|
See <https://github.com/hrkfdn/ncspot#configuration>
|
|
for the full list of options.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
|
|
|
xdg.configFile."ncspot/config.toml" = mkIf (cfg.settings != { }) {
|
|
source = tomlFormat.generate "ncspot-config" cfg.settings;
|
|
};
|
|
};
|
|
}
|