summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorHraban Luyat <hraban@0brg.net>2023-04-29 23:09:11 -0400
committerHraban Luyat <hraban@0brg.net>2023-05-15 13:13:18 -0400
commitf6b7489ddb316eb2b331e2f3a5ef43e11d8eff34 (patch)
treeff6614962cbfa98dab5042514c96c1db1c989fbf /modules
parent0dbf1c2fb1a5a0372a324eff1ba44f9da66febd2 (diff)
feat: defaults write com.apple.menuextra.clock
Diffstat (limited to 'modules')
-rw-r--r--modules/module-list.nix1
-rw-r--r--modules/system/defaults-write.nix3
-rw-r--r--modules/system/defaults/clock.nix71
3 files changed, 75 insertions, 0 deletions
diff --git a/modules/module-list.nix b/modules/module-list.nix
index 5cc6d2b..034ea76 100644
--- a/modules/module-list.nix
+++ b/modules/module-list.nix
@@ -16,6 +16,7 @@
./system/defaults/NSGlobalDomain.nix
./system/defaults/GlobalPreferences.nix
./system/defaults/CustomPreferences.nix
+ ./system/defaults/clock.nix
./system/defaults/dock.nix
./system/defaults/finder.nix
./system/defaults/screencapture.nix
diff --git a/modules/system/defaults-write.nix b/modules/system/defaults-write.nix
index ac9b024..9bf1963 100644
--- a/modules/system/defaults-write.nix
+++ b/modules/system/defaults-write.nix
@@ -29,6 +29,7 @@ let
GlobalPreferences = defaultsToList ".GlobalPreferences" cfg.".GlobalPreferences";
LaunchServices = defaultsToList "com.apple.LaunchServices" cfg.LaunchServices;
NSGlobalDomain = defaultsToList "-g" cfg.NSGlobalDomain;
+ clock = defaultsToList "com.apple.menuextra.clock" cfg.clock;
dock = defaultsToList "com.apple.dock" cfg.dock;
finder = defaultsToList "com.apple.finder" cfg.finder;
magicmouse = defaultsToList "com.apple.AppleMultitouchMouse" cfg.magicmouse;
@@ -80,6 +81,7 @@ in
GlobalPreferences
LaunchServices
NSGlobalDomain
+ clock
dock
finder
magicmouse
@@ -101,6 +103,7 @@ in
${concatStringsSep "\n" GlobalPreferences}
${concatStringsSep "\n" LaunchServices}
+ ${concatStringsSep "\n" clock}
${concatStringsSep "\n" dock}
${concatStringsSep "\n" finder}
${concatStringsSep "\n" magicmouse}
diff --git a/modules/system/defaults/clock.nix b/modules/system/defaults/clock.nix
new file mode 100644
index 0000000..9ec0471
--- /dev/null
+++ b/modules/system/defaults/clock.nix
@@ -0,0 +1,71 @@
+{ config, lib, ... }:
+
+with lib;
+
+{
+ options = {
+
+ system.defaults.clock.IsAnalog = mkOption {
+ type = types.nullOr types.bool;
+ default = null;
+ description = ''
+ Show an analog clock instead of a digital one. Default is null.
+ '';
+ };
+
+ system.defaults.clock.Show24Hour = mkOption {
+ type = types.nullOr types.bool;
+ default = null;
+ description = ''
+ Show a 24-hour clock, instead of a 12-hour clock. Default is null.
+ '';
+ };
+
+ system.defaults.clock.ShowAMPM = mkOption {
+ type = types.nullOr types.bool;
+ default = null;
+ description = ''
+ Show the AM/PM label. Useful if Show24Hour is false. Default is null.
+ '';
+ };
+
+ system.defaults.clock.ShowDayOfMonth = mkOption {
+ type = types.nullOr types.bool;
+ default = null;
+ description = ''
+ Show the day of the month. Default is null.
+ '';
+ };
+
+ system.defaults.clock.ShowDayOfWeek = mkOption {
+ type = types.nullOr types.bool;
+ default = null;
+ description = ''
+ Show the day of the week. Default is null.
+ '';
+ };
+
+ system.defaults.clock.ShowDate = mkOption {
+ type = types.nullOr (types.enum [ 0 1 2 ]);
+ default = null;
+ description = ''
+ Show the full date. Default is null.
+
+ 0 = Show the date
+ 1 = Don't show
+ 2 = Don't show
+
+ TODO: I don't know what the difference is between 1 and 2.
+ '';
+ };
+
+ system.defaults.clock.ShowSeconds = mkOption {
+ type = types.nullOr types.bool;
+ default = null;
+ description = ''
+ Show the clock with second precision, instead of minutes. Default is null.
+ '';
+ };
+
+ };
+}