mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 18:59:47 +01:00
2f857761d0
* ncspot: add module ncspot is a ncurses Spotify client written in Rust using librespot. * news: fix bad github ui merge Co-authored-by: Nicolas Berbiche <nicolas@normie.dev>
50 lines
1.1 KiB
Nix
50 lines
1.1 KiB
Nix
{ 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;
|
|
defaultText = literalExample "pkgs.ncspot";
|
|
description = "The package to use for ncspot.";
|
|
};
|
|
|
|
settings = mkOption {
|
|
type = tomlFormat.type;
|
|
default = { };
|
|
example = literalExample ''
|
|
{
|
|
shuffle = true;
|
|
gapless = true;
|
|
}
|
|
'';
|
|
description = ''
|
|
Configuration written to
|
|
<filename>~/.config/ncspot/config.toml</filename>.
|
|
</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;
|
|
};
|
|
};
|
|
}
|