Skip to content

Commit

Permalink
simple passthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
szethh committed Jul 12, 2024
1 parent cf297a8 commit ecaa208
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions modules/system/defaults/dock.nix
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ in {
};

system.defaults.dock.persistent-others = mkOption {
type = types.nullOr (types.listOf (types.either types.path types.str));
type = types.nullOr (types.listOf (types.oneOf [ types.path types.str (types.attrsOf types.anything) ] ));
default = null;
example = [ "~/Documents" "~/Downloads" ];
description = ''
Expand All @@ -146,7 +146,17 @@ in {
apply = value:
if !(isList value)
then value
else map (folder: { tile-data = { file-data = { _CFURLString = "file://" + folder; _CFURLStringType = 15; }; }; tile-type = if strings.hasInfix "." (last (splitString "/" folder)) then "file-tile" else "directory-tile"; }) value;
else map (folder:
if isPath folder || isString folder
then
{
tile-data = {
file-data = { _CFURLString = "file://" + folder; _CFURLStringType = 15; };
};
tile-type = if strings.hasInfix "." (last (splitString "/" folder)) then "file-tile" else "directory-tile";
}
else folder # pass through complex objects entirely
) value;
};

system.defaults.dock.show-process-indicators = mkOption {
Expand Down

0 comments on commit ecaa208

Please sign in to comment.