1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-06 09:01:04 +01:00
home-manager/modules/programs/ncspot.nix
Austin Horstman 0b491b460f
treewide: remove with lib (#6735)
Continuation of `with lib;` cleanup.
2025-03-31 22:32:16 -05:00

45 lines
1.1 KiB
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.programs.ncspot;
tomlFormat = pkgs.formats.toml { };
in {
meta.maintainers = [ ];
options.programs.ncspot = {
enable = lib.mkEnableOption "ncspot";
package = lib.mkOption {
type = lib.types.package;
default = pkgs.ncspot;
defaultText = lib.literalExpression "pkgs.ncspot";
description = "The package to use for ncspot.";
};
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 = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."ncspot/config.toml" = lib.mkIf (cfg.settings != { }) {
source = tomlFormat.generate "ncspot-config" cfg.settings;
};
};
}