2023-05-09 02:58:14 +03:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
2023-05-08 23:09:44 +03:00
|
|
|
cfg = config.programs.musikcube;
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
programs.musikcube = {
|
|
|
|
enable = lib.mkEnableOption "whether to enable musikcube";
|
|
|
|
package = lib.mkOption {
|
|
|
|
type = lib.types.package;
|
|
|
|
default = pkgs.musikcube;
|
|
|
|
};
|
|
|
|
settings = lib.mkOption {
|
|
|
|
type = (pkgs.formats.json {}).type;
|
|
|
|
default = builtins.fromJSON (builtins.readFile ./default-config.json);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
home.packages = [cfg.package];
|
2023-10-13 23:14:32 +03:00
|
|
|
home.persistence."${config.system.persistDir}${config.home.homeDirectory}".directories = [".config/musikcube"];
|
2023-05-08 23:09:44 +03:00
|
|
|
xdg.configFile."musikcube/settings.json".text = builtins.toJSON cfg.settings;
|
|
|
|
};
|
|
|
|
}
|