mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-13 09:12:08 -04: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:
@@ -9,8 +9,6 @@ let
|
|||||||
cfg = config.programs.dankMaterialShell;
|
cfg = config.programs.dankMaterialShell;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
qmlPath = "${dmsPkgs.dms-shell}/share/quickshell/dms";
|
|
||||||
|
|
||||||
packages = [
|
packages = [
|
||||||
dmsPkgs.dms-shell
|
dmsPkgs.dms-shell
|
||||||
]
|
]
|
||||||
@@ -27,4 +25,8 @@ in
|
|||||||
++ lib.optional cfg.enableAudioWavelength pkgs.cava
|
++ lib.optional cfg.enableAudioWavelength pkgs.cava
|
||||||
++ lib.optional cfg.enableCalendarEvents pkgs.khal
|
++ lib.optional cfg.enableCalendarEvents pkgs.khal
|
||||||
++ lib.optional cfg.enableSystemSound pkgs.kdePackages.qtmultimedia;
|
++ lib.optional cfg.enableSystemSound pkgs.kdePackages.qtmultimedia;
|
||||||
|
|
||||||
|
plugins = lib.mapAttrs (name: plugin: {
|
||||||
|
source = plugin.src;
|
||||||
|
}) (lib.filterAttrs (n: v: v.enable) cfg.plugins);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ in
|
|||||||
plugins = lib.mkOption {
|
plugins = lib.mkOption {
|
||||||
type = attrsOf (
|
type = attrsOf (
|
||||||
types.submodule (
|
types.submodule (
|
||||||
{ config, ... }:
|
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
@@ -73,8 +72,6 @@ in
|
|||||||
programs.quickshell = {
|
programs.quickshell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
inherit (cfg.quickshell) package;
|
inherit (cfg.quickshell) package;
|
||||||
|
|
||||||
configs.dms = common.qmlPath;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
|
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
|
||||||
@@ -82,7 +79,6 @@ in
|
|||||||
Description = "DankMaterialShell";
|
Description = "DankMaterialShell";
|
||||||
PartOf = [ config.wayland.systemd.target ];
|
PartOf = [ config.wayland.systemd.target ];
|
||||||
After = [ config.wayland.systemd.target ];
|
After = [ config.wayland.systemd.target ];
|
||||||
X-Restart-Triggers = lib.optional cfg.systemd.restartIfChanged common.qmlPath;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
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 {
|
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
|
||||||
description = "DankMaterialShell";
|
description = "DankMaterialShell";
|
||||||
path = lib.mkForce [ ];
|
path = lib.mkForce [ ];
|
||||||
@@ -31,7 +29,7 @@ in
|
|||||||
partOf = [ "graphical-session.target" ];
|
partOf = [ "graphical-session.target" ];
|
||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
restartTriggers = lib.optional cfg.systemd.restartIfChanged common.qmlPath;
|
restartIfChanged = cfg.systemd.restartIfChanged;
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = lib.getExe dmsPkgs.dms-shell + " run --session";
|
ExecStart = lib.getExe dmsPkgs.dms-shell + " run --session";
|
||||||
|
|||||||
@@ -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).";
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user