1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-06 16:57:08 +00:00
nix-darwin/modules/system/defaults/finder.nix

153 lines
4.5 KiB
Nix
Raw Normal View History

2016-12-14 13:05:23 +01:00
{ config, lib, ... }:
let
inherit (lib) mkOption types;
2016-12-14 13:05:23 +01:00
cfg = config.system.defaults.finder;
in
2016-12-14 13:05:23 +01:00
{
options = {
2022-03-10 00:12:30 -08:00
system.defaults.finder.AppleShowAllFiles = mkOption {
type = types.nullOr types.bool;
default = null;
2024-04-14 23:02:32 +02:00
description = ''
2022-03-10 00:12:30 -08:00
Whether to always show hidden files. The default is false.
'';
};
2022-03-10 00:43:27 -08:00
system.defaults.finder.ShowStatusBar = mkOption {
type = types.nullOr types.bool;
default = null;
2024-04-14 23:02:32 +02:00
description = ''
2022-03-10 00:43:27 -08:00
Show status bar at bottom of finder windows with item/disk space stats. The default is false.
'';
};
system.defaults.finder.ShowPathbar = mkOption {
type = types.nullOr types.bool;
default = null;
2024-04-14 23:02:32 +02:00
description = ''
2022-03-10 00:43:27 -08:00
Show path breadcrumbs in finder windows. The default is false.
'';
};
system.defaults.finder.FXDefaultSearchScope = mkOption {
type = types.nullOr types.str;
2022-03-10 00:43:27 -08:00
default = null;
2024-04-14 23:02:32 +02:00
description = ''
2022-03-10 00:43:27 -08:00
Change the default search scope. Use "SCcf" to default to current folder.
The default is unset ("This Mac").
'';
};
system.defaults.finder.FXPreferredViewStyle = mkOption {
type = types.nullOr types.str;
default = null;
2024-04-14 23:02:32 +02:00
description = ''
2022-03-10 00:43:27 -08:00
Change the default finder view.
"icnv" = Icon view, "Nlsv" = List view, "clmv" = Column View, "Flwv" = Gallery View
The default is icnv.
'';
};
2016-12-14 13:05:23 +01:00
system.defaults.finder.AppleShowAllExtensions = mkOption {
type = types.nullOr types.bool;
default = null;
2024-04-14 23:02:32 +02:00
description = ''
2016-12-14 16:30:55 +01:00
Whether to always show file extensions. The default is false.
'';
};
system.defaults.finder.CreateDesktop = mkOption {
type = types.nullOr types.bool;
default = null;
2024-04-14 23:02:32 +02:00
description = ''
Whether to show icons on the desktop or not. The default is true.
'';
};
2016-12-14 16:30:55 +01:00
system.defaults.finder.QuitMenuItem = mkOption {
type = types.nullOr types.bool;
default = null;
2024-04-14 23:02:32 +02:00
description = ''
2016-12-14 16:30:55 +01:00
Whether to allow quitting of the Finder. The default is false.
'';
};
system.defaults.finder._FXShowPosixPathInTitle = mkOption {
type = types.nullOr types.bool;
default = null;
2024-04-14 23:02:32 +02:00
description = ''
2016-12-14 16:30:55 +01:00
Whether to show the full POSIX filepath in the window title. The default is false.
'';
};
system.defaults.finder._FXSortFoldersFirst = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Keep folders on top when sorting by name. The default is false.
'';
};
2016-12-14 16:30:55 +01:00
system.defaults.finder.FXEnableExtensionChangeWarning = mkOption {
type = types.nullOr types.bool;
default = null;
2024-04-14 23:02:32 +02:00
description = ''
2016-12-14 16:30:55 +01:00
Whether to show warnings when change the file extension of files. The default is true.
'';
2016-12-14 13:05:23 +01:00
};
system.defaults.finder.NewWindowTarget = mkOption {
type = types.nullOr (types.enum [
"Computer"
"OS volume"
"Home"
"Desktop"
"Documents"
"Recents"
"iCloud Drive"
"Other"
]);
apply = key: if key == null then null else {
"Computer" = "PfCm";
"OS volume" = "PfVo";
"Home" = "PfHm";
"Desktop" = "PfDe";
"Documents" = "PfDo";
"Recents" = "PfAF";
"iCloud Drive" = "PfID";
"Other" = "PfLo";
}.${key};
default = null;
description = ''
Change the default folder shown in Finder windows. "Other" corresponds to the value of
NewWindowTargetPath. The default is unset ("Recents").
'';
};
system.defaults.finder.NewWindowTargetPath = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Sets the URI to open when NewWindowTarget is "Other". Spaces and similar characters must be
escaped. If the value is invalid, Finder will open your home directory.
Example: "file:///Users/foo/long%20cat%20pics".
The default is unset.
'';
};
};
config = {
assertions = [{
assertion = cfg.NewWindowTargetPath != null -> cfg.NewWindowTarget == "PfLo";
message = "`system.defaults.finder.NewWindowTarget` should be set to `Other` when `NewWindowTargetPath` is non-null.";
}
{
assertion = cfg.NewWindowTarget == "PfLo" -> cfg.NewWindowTargetPath != null;
message = "`system.defaults.finder.NewWindowTargetPath` should be non-null when `NewWindowTarget` is set to `Other`.";
}];
2016-12-14 13:05:23 +01:00
};
}