1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-14 09:42:10 -04:00

feat(nix/niri): add new includes for dms 1.4 (#1998)

This commit is contained in:
NikSne
2026-03-15 10:09:00 +03:00
committed by GitHub
parent 1661d32641
commit 4cf9b0adc7

View File

@@ -2,11 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
let
cfg = config.programs.dank-material-shell; cfg = config.programs.dank-material-shell;
in in {
{
imports = [ imports = [
./dms-rename.nix ./dms-rename.nix
]; ];
@@ -16,9 +14,11 @@ in
enableKeybinds = lib.mkEnableOption "DankMaterialShell niri keybinds"; enableKeybinds = lib.mkEnableOption "DankMaterialShell niri keybinds";
enableSpawn = lib.mkEnableOption "DankMaterialShell niri spawn-at-startup"; enableSpawn = lib.mkEnableOption "DankMaterialShell niri spawn-at-startup";
includes = { includes = {
enable = (lib.mkEnableOption "includes for niri-flake") // { enable =
default = true; (lib.mkEnableOption "includes for niri-flake")
}; // {
default = true;
};
override = lib.mkOption { override = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
description = '' description = ''
@@ -44,8 +44,10 @@ in
"alttab" "alttab"
"binds" "binds"
"colors" "colors"
"cursor"
"layout" "layout"
"outputs" "outputs"
"windowrules"
"wpblur" "wpblur"
]; ];
example = [ example = [
@@ -70,24 +72,21 @@ in
let let
cfg' = cfg.niri.includes; cfg' = cfg.niri.includes;
withOriginalConfig = withOriginalConfig = dmsFiles:
dmsFiles: if cfg'.override
if cfg'.override then then [cfg'.originalFileName] ++ dmsFiles
[ cfg'.originalFileName ] ++ dmsFiles else dmsFiles ++ [cfg'.originalFileName];
else
dmsFiles ++ [ cfg'.originalFileName ];
fixes = map (fix: "\n${fix}") ( fixes = map (fix: "\n${fix}") (
lib.optional (cfg'.enable && config.programs.niri.settings.layout.border.enable) lib.optional (cfg'.enable && config.programs.niri.settings.layout.border.enable)
# kdl # kdl
'' ''
// Border fix // Border fix
// See https://yalter.github.io/niri/Configuration%3A-Include.html#border-special-case for details // See https://yalter.github.io/niri/Configuration%3A-Include.html#border-special-case for details
layout { border { on; }; } layout { border { on; }; }
'' ''
); );
in in {
{
niri-config.target = lib.mkForce "niri/${cfg'.originalFileName}.kdl"; niri-config.target = lib.mkForce "niri/${cfg'.originalFileName}.kdl";
niri-config-dms = { niri-config-dms = {
target = "niri/config.kdl"; target = "niri/config.kdl";
@@ -104,11 +103,9 @@ in
programs.niri.settings = lib.mkMerge [ programs.niri.settings = lib.mkMerge [
(lib.mkIf cfg.niri.enableKeybinds { (lib.mkIf cfg.niri.enableKeybinds {
binds = binds = with config.lib.niri.actions; let
with config.lib.niri.actions; dms-ipc = spawn "dms" "ipc";
let in
dms-ipc = spawn "dms" "ipc";
in
{ {
"Mod+Space" = { "Mod+Space" = {
action = dms-ipc "spotlight" "toggle"; action = dms-ipc "spotlight" "toggle";