Files
home-manager/modules/programs/ncspot.nix
Austin Horstman 355734d876 treewide: remove literalExpression where unneeded
`literalExpression` is intended just to signify code that needs to stay
a string that gets represented exactly as-is for docs. It has been
misused heavily and people get confused repeatedly on when or not to use
it because of the rampant misuse.
2026-05-17 21:43:25 -05:00

47 lines
967 B
Nix

{
config,
lib,
pkgs,
...
}:
let
inherit (lib) mkIf;
cfg = config.programs.ncspot;
tomlFormat = pkgs.formats.toml { };
in
{
meta.maintainers = [ lib.maintainers.da157 ];
options.programs.ncspot = {
enable = lib.mkEnableOption "ncspot";
package = lib.mkPackageOption pkgs "ncspot" { nullable = true; };
settings = lib.mkOption {
inherit (tomlFormat) type;
default = { };
example = {
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;
};
};
}