diff --git a/distro/nix/common.nix b/distro/nix/common.nix index a2b3caea..98147790 100644 --- a/distro/nix/common.nix +++ b/distro/nix/common.nix @@ -9,8 +9,6 @@ let cfg = config.programs.dankMaterialShell; in { - qmlPath = "${dmsPkgs.dms-shell}/share/quickshell/dms"; - packages = [ dmsPkgs.dms-shell ] @@ -27,4 +25,8 @@ in ++ lib.optional cfg.enableAudioWavelength pkgs.cava ++ lib.optional cfg.enableCalendarEvents pkgs.khal ++ lib.optional cfg.enableSystemSound pkgs.kdePackages.qtmultimedia; + + plugins = lib.mapAttrs (name: plugin: { + source = plugin.src; + }) (lib.filterAttrs (n: v: v.enable) cfg.plugins); } diff --git a/distro/nix/home.nix b/distro/nix/home.nix index 90f62c3b..4c6ecf13 100644 --- a/distro/nix/home.nix +++ b/distro/nix/home.nix @@ -48,7 +48,6 @@ in plugins = lib.mkOption { type = attrsOf ( types.submodule ( - { config, ... }: { options = { enable = lib.mkOption { @@ -73,8 +72,6 @@ in programs.quickshell = { enable = true; inherit (cfg.quickshell) package; - - configs.dms = common.qmlPath; }; systemd.user.services.dms = lib.mkIf cfg.systemd.enable { @@ -82,7 +79,6 @@ in Description = "DankMaterialShell"; PartOf = [ config.wayland.systemd.target ]; After = [ config.wayland.systemd.target ]; - X-Restart-Triggers = lib.optional cfg.systemd.restartIfChanged common.qmlPath; }; Service = { diff --git a/distro/nix/nixos.nix b/distro/nix/nixos.nix index 6d533326..24a231b1 100644 --- a/distro/nix/nixos.nix +++ b/distro/nix/nixos.nix @@ -22,8 +22,6 @@ in ]; config = lib.mkIf cfg.enable { - environment.etc."xdg/quickshell/dms".source = "${dmsPkgs.dms-shell}/share/quickshell/dms"; - systemd.user.services.dms = lib.mkIf cfg.systemd.enable { description = "DankMaterialShell"; path = lib.mkForce [ ]; @@ -31,7 +29,7 @@ in partOf = [ "graphical-session.target" ]; after = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ]; - restartTriggers = lib.optional cfg.systemd.restartIfChanged common.qmlPath; + restartIfChanged = cfg.systemd.restartIfChanged; serviceConfig = { ExecStart = lib.getExe dmsPkgs.dms-shell + " run --session"; diff --git a/distro/nix/options.nix b/distro/nix/options.nix index 80465b7e..05c1ac6c 100644 --- a/distro/nix/options.nix +++ b/distro/nix/options.nix @@ -68,5 +68,41 @@ in extraDescription = "The quickshell package to use (defaults to be built from source, in the commit 26531f due to unreleased features used by DMS)."; }; }; + + plugins = lib.mkOption { + type = types.attrsOf ( + types.submodule { + options = { + enable = lib.mkOption { + type = types.bool; + default = true; + description = "Whether to enable this plugin"; + }; + src = lib.mkOption { + type = types.package; + description = "Source of the plugin package or path"; + }; + }; + } + ); + default = { }; + description = "DMS Plugins to install and enable"; + example = lib.literalExpression '' + { + DockerManager = { + src = pkgs.fetchFromGitHub { + owner = "LuckShiba"; + repo = "DmsDockerManager"; + rev = "v1.2.0"; + sha256 = "sha256-VoJCaygWnKpv0s0pqTOmzZnPM922qPDMHk4EPcgVnaU="; + }; + }; + AnotherPlugin = { + enable = true; + src = pkgs.another-plugin; + }; + } + ''; + }; }; }