1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

nix: add plugins in NixOS module (#970)

* nix: remove unnecessary /etc/xdg/quickshell/dms and .config/quickshell/dms

* nix: add plugins in NixOS module
This commit is contained in:
Lucas
2025-12-11 05:03:22 -03:00
committed by GitHub
parent 1db3907838
commit d8cd15d361
4 changed files with 41 additions and 9 deletions

View File

@@ -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);
}

View File

@@ -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 = {

View File

@@ -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";

View File

@@ -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;
};
}
'';
};
};
}