Add DMS configuration enhancements and new default settings
- Introduced a new private default settings file for Dank Material Shell (DMS) to manage user-specific settings. - Updated DMS home-manager module to generate a settings seed file, merging extra right-bar widgets into the first-run configuration. - Added support for dynamic inclusion of DMS window rules based on user configuration. - Enhanced the Niri configuration with a preference for no client-side decorations and improved keybindings for bar toggling.
This commit is contained in:
@@ -14,6 +14,7 @@ let
|
||||
};
|
||||
input."warp-mouse-to-focus" = _: { };
|
||||
layout.gaps = 5;
|
||||
prefer-no-csd = true;
|
||||
|
||||
window-rules = [
|
||||
{
|
||||
@@ -62,7 +63,7 @@ let
|
||||
"Mod+N"."spawn-sh" = "dms ipc call notepad toggle"; #TODO[epic=Binds] This should only be set if having dms
|
||||
"Mod+Shift+N"."spawn-sh" = "dms ipc call notifications toggle"; #TODO[epic=Binds] This should only be set if having dms
|
||||
"Mod+M"."spawn-sh" = "dms ipc call processlist toggle"; #TODO[epic=Binds] This should only be set if having dms
|
||||
"Mod+B"."spawn-sh" = "dms ipc call bar toggle name \"Main Bar\""; #TODO[epic=Binds] This should only be set if having dms
|
||||
"Mod+B"."spawn-sh" = "dms ipc call bar toggle name \"Main Bar\"; dms ipc call bar toggle name \"Bar 2\""; #TODO[epic=Binds] This should only be set if having dms
|
||||
"Mod+Shift+B"."spawn-sh" = "dms ipc call bar toggle name \"Bar 2\""; #TODO[epic=Binds] This should only be set if having dms
|
||||
"Mod+L"."spawn-sh" = "dms ipc call lock lock"; #TODO[epic=Binds] This should only be set if having dms
|
||||
|
||||
@@ -178,28 +179,55 @@ let
|
||||
// lib.optionalAttrs (windowRules != [ ]) {
|
||||
window-rules = windowRules;
|
||||
}
|
||||
// lib.optionalAttrs (rpi5Extra != "" || (userExtra.extraConfig or "") != "") {
|
||||
// lib.optionalAttrs (extraConfigMerged != "") {
|
||||
extraConfig = extraConfigMerged;
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
flake.homeManagerModules.desktopNiri =
|
||||
{ lib, pkgs, osConfig ? { }, ... }:
|
||||
{ config, lib, pkgs, osConfig ? { }, ... }:
|
||||
let
|
||||
home = config.home.homeDirectory;
|
||||
niriOs = osConfig.chiasson.desktop.niri or { };
|
||||
niriEnabled = osConfig.chiasson.desktop.niri.enable or false;
|
||||
keyringEnabled = osConfig.chiasson.desktop.keyring.enable or false;
|
||||
mergedSettings = mergeNiriSettings pkgs niriOs keyringEnabled;
|
||||
dmsEnabled = (osConfig.chiasson.desktop.shell or null) == "dms";
|
||||
dmsWindowRulesPath = "${home}/.config/niri/dms/windowrules.kdl";
|
||||
# wrapper-modules emits quoted KDL (`"include" "…"`) which DMS's parser ignores.
|
||||
# config.kdl is a store symlink, so a relative include would not resolve to the real
|
||||
# ~/.config/niri/dms/windowrules.kdl that DMS writes at runtime.
|
||||
dmsWindowRulesInclude = lib.optionalString dmsEnabled ''
|
||||
include "${dmsWindowRulesPath}"
|
||||
'';
|
||||
baseMergedSettings = mergeNiriSettings pkgs niriOs keyringEnabled;
|
||||
mergedSettings = lib.recursiveUpdate baseMergedSettings {
|
||||
extraConfig = dmsWindowRulesInclude + (baseMergedSettings.extraConfig or "");
|
||||
};
|
||||
niriConfigPkg = inputs.wrapper-modules.wrappers.niri.wrap {
|
||||
inherit pkgs;
|
||||
settings = mergedSettings;
|
||||
# User-owned rules path is not available during the Nix build.
|
||||
disableConfigValidation = dmsEnabled;
|
||||
};
|
||||
in
|
||||
{
|
||||
config = lib.mkIf niriEnabled {
|
||||
xdg.configFile."niri/config.kdl".source = "${niriConfigPkg}/niri-config.kdl";
|
||||
};
|
||||
config = lib.mkIf niriEnabled (lib.mkMerge [
|
||||
{
|
||||
xdg.configFile."niri/config.kdl".source = "${niriConfigPkg}/niri-config.kdl";
|
||||
}
|
||||
(lib.mkIf dmsEnabled {
|
||||
# Seed empty rules file so niri can load the include before DMS first deploy.
|
||||
home.activation.dmsNiriWindowRulesSeed = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
rulesDir="$HOME/.config/niri/dms"
|
||||
rulesFile="$rulesDir/windowrules.kdl"
|
||||
mkdir -p "$rulesDir"
|
||||
if [ ! -e "$rulesFile" ]; then
|
||||
${pkgs.coreutils}/bin/touch "$rulesFile"
|
||||
fi
|
||||
'';
|
||||
})
|
||||
]);
|
||||
};
|
||||
|
||||
flake.nixosModules.desktopNiri =
|
||||
|
||||
Reference in New Issue
Block a user