mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
Re-introduce default settings option and fix dms-cli build (#366)
* Reapply "Add default configuration option to home-manager (#356)"
This reverts commit bc23109f99.
* fix multiple xdg.configFile definitions error
* update dms-cli flake to fix build
This commit is contained in:
committed by
GitHub
parent
7dc723c764
commit
55d9fa622a
6
flake.lock
generated
6
flake.lock
generated
@@ -27,11 +27,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1759946376,
|
"lastModified": 1759982027,
|
||||||
"narHash": "sha256-/kQpJPH1y+U6V7N3bbGzvNRGfk9VuxdZev9Os4bS5ZQ=",
|
"narHash": "sha256-4deRT98VwfZWZ685wIGevyYl3CzpuZJPjdjfulABH00=",
|
||||||
"owner": "AvengeMedia",
|
"owner": "AvengeMedia",
|
||||||
"repo": "danklinux",
|
"repo": "danklinux",
|
||||||
"rev": "98db89ffba290265bc4a886d13b8a27a53fdaca1",
|
"rev": "5cdfeeae2e14089079dcb0d6b61f014ce754021f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
cfg = config.programs.dankMaterialShell;
|
cfg = config.programs.dankMaterialShell;
|
||||||
|
jsonFormat = pkgs.formats.json { };
|
||||||
in {
|
in {
|
||||||
options.programs.dankMaterialShell = with lib.types; {
|
options.programs.dankMaterialShell = with lib.types; {
|
||||||
enable = lib.mkEnableOption "DankMaterialShell";
|
enable = lib.mkEnableOption "DankMaterialShell";
|
||||||
@@ -54,6 +55,20 @@ in {
|
|||||||
quickshell = {
|
quickshell = {
|
||||||
package = lib.mkPackageOption pkgs "quickshell" {};
|
package = lib.mkPackageOption pkgs "quickshell" {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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 {
|
plugins = lib.mkOption {
|
||||||
type = attrsOf (types.submodule ({ config, ... }: {
|
type = attrsOf (types.submodule ({ config, ... }: {
|
||||||
options = {
|
options = {
|
||||||
@@ -99,10 +114,21 @@ in {
|
|||||||
Install.WantedBy = [ config.wayland.systemd.target ];
|
Install.WantedBy = [ config.wayland.systemd.target ];
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile = lib.mapAttrs' (name: plugin: {
|
xdg.stateFile."DankMaterialShell/default-session.json" = lib.mkIf (cfg.default.session != { }) {
|
||||||
name = "DankMaterialShell/plugins/${name}";
|
source = jsonFormat.generate "default-session.json" cfg.default.session;
|
||||||
value.source = plugin.src;
|
};
|
||||||
}) (lib.filterAttrs (n: v: v.enable) cfg.plugins);
|
|
||||||
|
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 =
|
home.packages =
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user