Add default settings file support for Dank Material Shell (DMS)

- Introduced a new option `defaultSettingsFile` in the DMS configuration to allow host-specific first-run settings.
- Updated the home-manager module to read from the specified settings file if provided, otherwise falling back to the bundled defaults.
- Enhanced the documentation in the default settings file to clarify its purpose and usage.
This commit is contained in:
2026-06-20 21:39:48 -03:00
parent de1f9fc770
commit 02c6b3a45f
5 changed files with 709 additions and 6 deletions
@@ -59,10 +59,14 @@
'';
jsonFormat = pkgs.formats.json { };
dmsSeedSettings = import ../_private/default-settings.nix {
inherit lib gpuTempEnabled;
extraRightBarWidgets = cfg.extraRightBarWidgets;
};
dmsSeedSettings =
if cfg.defaultSettingsFile != null then
builtins.fromJSON (builtins.readFile cfg.defaultSettingsFile)
else
import ../_private/default-settings.nix {
inherit lib gpuTempEnabled;
extraRightBarWidgets = cfg.extraRightBarWidgets;
};
dmsSeedFile = jsonFormat.generate "dms-settings-seed.json" dmsSeedSettings;
dmsSettingsPath = "${config.xdg.configHome}/DankMaterialShell/settings.json";
@@ -126,6 +130,15 @@ in {
dms.enableRbwLockToggle = lib.mkEnableOption ''
Ship rbw-lock-toggle into `~/.config/DankMaterialShell/plugins/rbwLockToggle/` (directory name matches plugin id; Bitwarden vault lock/unlock in the bar).
'';
dms.defaultSettingsFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
Host-specific first-run `settings.json` seed. When set, replaces the bundled
`default-settings.nix` template on fresh profiles.
'';
};
};
imports = [