Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: LnL7/nix-darwin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 50105191ac589af4be7bc5ce79c5d740ef2cff48
Choose a base ref
..
head repository: LnL7/nix-darwin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0c9bacc822ae984be5e0076d32ce169b7e21853d
Choose a head ref
Showing with 16 additions and 6 deletions.
  1. +10 −2 modules/system/defaults/dock.nix
  2. +6 −4 tests/fixtures/system-defaults-write/activate-user.txt
12 changes: 10 additions & 2 deletions modules/system/defaults/dock.nix
Original file line number Diff line number Diff line change
@@ -180,14 +180,22 @@ in {
toTile = item: if item ? app then {
tile-data = { file-data = { _CFURLString = item.app.path; _CFURLStringType = 0; }; };
} else if item ? spacer then {
tile-data = { tile-type = if item.spacer.small then "small-spacer-tile" else "spacer-tile"; };
tile-data = {};
tile-type = if item.spacer.small then "small-spacer-tile" else "spacer-tile";
} else if item ? folder then {
tile-data = { file-data = { _CFURLString = item.folder.path; _CFURLStringType = 0; }; };
} else item;
in
value: if isList value then map toTile value else value;
};

# apply =
# let
# tileTypes = ["spacer-tile" "small-spacer-tile"];
# toSpecialTile = type: { tile-data = {}; tile-type = type; };
# toAppTile = cfurl: { tile-data = { file-data = { _CFURLString = cfurl; _CFURLStringType = 0; }; }; };
# toTile = s: if elem s tileTypes then toSpecialTile s else toAppTile s;
# in
# value: if isList value then map toTile value else value;
system.defaults.dock.persistent-others = mkOption {
type = types.nullOr (types.listOf (types.either types.path types.str));
default = null;
10 changes: 6 additions & 4 deletions tests/fixtures/system-defaults-write/activate-user.txt
Original file line number Diff line number Diff line change
@@ -288,16 +288,18 @@ defaults write com.apple.dock 'persistent-apps' $'<?xml version="1.0" encoding="
<dict>
<key>tile-data</key>
<dict>
<key>tile-type</key>
<string>small-spacer-tile</string>

</dict>
<key>tile-type</key>
<string>small-spacer-tile</string>
</dict>
<dict>
<key>tile-data</key>
<dict>
<key>tile-type</key>
<string>spacer-tile</string>

</dict>
<key>tile-type</key>
<string>spacer-tile</string>
</dict>
<dict>
<key>tile-data</key>