diff --git a/README.md b/README.md index 6231da1d..ec5c86b1 100644 --- a/README.md +++ b/README.md @@ -661,6 +661,16 @@ cp -R ./PLUGINS/ExampleEmojiPlugin ~/.config/DankMaterialShell/plugins **Only install plugins from TRUSTED sources.** Plugins execute QML and javascript at runtime, plugins from third parties should be reviewed before enabling them in dms. +### nixOS - via home-manager + +Add the following to your home-manager config to install a plugin: + +```nix +programs.dankMaterialShell.plugins = { + ExampleEmojiPlugin.src = "${inputs.dankMaterialShell}/PLUGINS/ExampleEmojiPlugin"; +}; +``` + ### Calendar Setup Sync your caldev compatible calendar (Google, Office365, etc.) for dashboard integration: diff --git a/nix/default.nix b/nix/default.nix index 0075897e..3f6f1c06 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -54,6 +54,23 @@ in { quickshell = { package = lib.mkPackageOption pkgs "quickshell" {}; }; + plugins = lib.mkOption { + type = attrsOf (types.submodule ({ config, ... }: { + options = { + enable = lib.mkOption { + type = types.bool; + default = true; + description = "Whether to link this plugin"; + }; + src = lib.mkOption { + type = types.path; + description = "Source to link to DMS plugins directory"; + }; + }; + })); + default = {}; + description = "DMS Plugins to install"; + }; }; config = lib.mkIf cfg.enable @@ -73,6 +90,11 @@ in { }; }; + xdg.configFile = lib.mapAttrs' (name: plugin: { + name = "DankMaterialShell/plugins/${name}"; + value.source = plugin.src; + }) (lib.filterAttrs (n: v: v.enable) cfg.plugins); + home.packages = [ pkgs.material-symbols