1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00
Files
DankMaterialShell/distro/nix/home.nix
Jon Rogers b84308cb49 packaging: Add dms-open.desktop and danklogo.svg to all distribution packages (#870)
* packaging: add dms-open.desktop and danklogo.svg to all distributions

- Add dms-open.desktop to /usr/share/applications
- Add danklogo.svg to /usr/share/icons/hicolor/scalable/apps
- Updated packaging for:
  - Fedora (dms.spec)
  - OpenSUSE (dms.spec, dms-git.spec)
  - Debian (dms, dms-git)
  - Ubuntu (dms, dms-git)

Fixes #860

* nix: add dms-open.desktop and danklogo.svg to dankMaterialShell package

* Revert "packaging: add dms-open.desktop and danklogo.svg to all distributions"

This reverts commit 862a4fc405.

* nix: add dankMaterialShell to pkgs

---------

Co-authored-by: LuckShiba <luckshiba@protonmail.com>
2025-12-02 22:32:59 -03:00

95 lines
3.2 KiB
Nix

{
config,
pkgs,
lib,
dmsPkgs,
...
}: let
cfg = config.programs.dankMaterialShell;
jsonFormat = pkgs.formats.json {};
common = import ./common.nix {inherit config pkgs lib dmsPkgs;};
in {
imports = [
./options.nix
(lib.mkRemovedOptionModule ["programs" "dankMaterialShell" "enableNightMode"] "Night mode is now always available.")
(lib.mkRenamedOptionModule ["programs" "dankMaterialShell" "enableSystemd"] ["programs" "dankMaterialShell" "systemd" "enable"])
];
options.programs.dankMaterialShell = with lib.types; {
default = {
settings = lib.mkOption {
type = jsonFormat.type;
default = {};
description = "The default settings are only read if the settings.json file don't exist";
};
session = lib.mkOption {
type = jsonFormat.type;
default = {};
description = "The default session are only read if the session.json file don't exist";
};
};
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
{
programs.quickshell = {
enable = true;
package = cfg.quickshell.package;
configs.dms = common.qmlPath;
};
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
Unit = {
Description = "DankMaterialShell";
PartOf = [config.wayland.systemd.target];
After = [config.wayland.systemd.target];
X-Restart-Triggers = lib.optional cfg.systemd.restartIfChanged common.qmlPath;
};
Service = {
ExecStart = lib.getExe dmsPkgs.dmsCli + " run --session";
Restart = "on-failure";
};
Install.WantedBy = [config.wayland.systemd.target];
};
xdg.stateFile."DankMaterialShell/default-session.json" = lib.mkIf (cfg.default.session != {}) {
source = jsonFormat.generate "default-session.json" cfg.default.session;
};
xdg.configFile = lib.mkMerge [
(lib.mapAttrs' (name: plugin: {
name = "DankMaterialShell/plugins/${name}";
value.source = plugin.src;
}) (lib.filterAttrs (n: v: v.enable) cfg.plugins))
{
"DankMaterialShell/default-settings.json" = lib.mkIf (cfg.default.settings != {}) {
source = jsonFormat.generate "default-settings.json" cfg.default.settings;
};
}
];
home.packages = common.packages ++ [dmsPkgs.dankMaterialShell];
};
}