fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . programs . ncspot ; 8 9tomlFormat = pkgs . formats . toml { }; 10 11in { 12meta . maintainers = [ ]; 13 14options . programs . ncspot = { 15enable = mkEnableOption "ncspot" ; 16 17package = mkOption { 18type = types . package ; 19default = pkgs . ncspot ; 20defaultText = literalExpression "pkgs.ncspot" ; 21description = "The package to use for ncspot." ; 22}; 23 24settings = mkOption { 25type = tomlFormat . type ; 26default = { }; 27example = literalExpression '' 28{ 29shuffle = true; 30gapless = true; 31} 32'' ; 33description = '' 34Configuration written to 35{file}`$XDG_CONFIG_HOME/ncspot/config.toml`. 36 37See <https://github.com/hrkfdn/ncspot#configuration> 38for the full list of options. 39'' ; 40}; 41}; 42 43config = mkIf cfg . enable { 44home . packages = [ cfg . package ]; 45 46xdg . configFile . "ncspot/config.toml" = mkIf ( cfg . settings != { }) { 47source = tomlFormat . generate "ncspot-config" cfg . settings ; 48}; 49}; 50}