diff --git a/modules/system/defaults/dock.nix b/modules/system/defaults/dock.nix index 2d5c16198..9acd5825e 100644 --- a/modules/system/defaults/dock.nix +++ b/modules/system/defaults/dock.nix @@ -131,9 +131,16 @@ in { Persistent applications in the dock. ''; apply = value: + let + tileTypes = ["spacer-tile" "small-spacer-tile"]; + in if !(isList value) then value - else map (app: { tile-data = { file-data = { _CFURLString = app; _CFURLStringType = 0; }; }; }) value; + else map (app: + if elem app tileTypes + then { tile-data = {}; tile-type = app; } + else { tile-data = { file-data = { _CFURLString = app; _CFURLStringType = 0; }; }; } + ) value; }; system.defaults.dock.persistent-others = mkOption { diff --git a/tests/system-defaults-write.nix b/tests/system-defaults-write.nix index 078cf82f5..eccf53eea 100644 --- a/tests/system-defaults-write.nix +++ b/tests/system-defaults-write.nix @@ -49,7 +49,7 @@ system.defaults.dock.appswitcher-all-displays = false; system.defaults.dock.autohide-delay = 0.24; system.defaults.dock.orientation = "left"; - system.defaults.dock.persistent-apps = ["MyApp.app" "Cool.app"]; + system.defaults.dock.persistent-apps = ["MyApp.app" "Cool.app" "small-spacer-tile" "spacer-tile"]; system.defaults.dock.persistent-others = ["~/Documents" "~/Downloads/file.txt"]; system.defaults.dock.scroll-to-open = false; system.defaults.finder.AppleShowAllFiles = true;