Commit graph

434 commits

Author SHA1 Message Date
zowoq
36fed93cf5 fold -> foldr
deprecated in f4d36941eb
2025-11-26 19:41:19 +10:00
zowoq
31e3a75444 applications: change pathsToLink to a list
fbe214434a
2025-11-14 09:54:32 +10:00
Yiyu Zhou
7451154694 Add system.defaults.finder._FXEnableColumnAutoSizing 2025-11-06 14:29:09 -08:00
Sam
c3c8c9f2a5
feat(trackpad): add additional trackpad and gesture support (#1591)
Some checks failed
Test / test-stable (push) Has been cancelled
Test / install-against-stable (push) Has been cancelled
Test / install-flake (push) Has been cancelled
Update website / Build (push) Has been cancelled
Update website / Deploy (push) Has been cancelled
2025-11-01 23:27:41 +00:00
Sam
fc4e3dbe40
feat: make persistent-others similar to the new persistent-apps (#1431) 2025-11-01 18:33:40 +00:00
Quintus Cardozo
5206a9fd30
Correct enum values for system.defaults.NSGlobalDomain.AppleIconAppearanceTheme 2025-09-21 13:59:38 +10:00
Quintus Cardozo
3c7396a09c
Add system.defaults.NSGlobalDomain.AppleIconAppearanceTheme 2025-09-19 13:58:48 +10:00
Dusty Pomerleau
d55543d033 feat(trackpad): add additional trackpad and gesture support:
To `system.defaults.trackpad`, add:

```
ActuateDetents
DragLock
ForceSuppressed
TrackpadCornerSecondaryClick
TrackpadFourFingerHorizSwipeGesture
TrackpadFourFingerPinchGesture
TrackpadFourFingerVertSwipeGesture
TrackpadMomentumScroll
TrackpadPinch
TrackpadRotate
TrackpadThreeFingerHorizSwipeGesture
TrackpadThreeFingerTapGesture
TrackpadThreeFingerVertSwipeGesture
TrackpadTwoFingerDoubleTapGesture
TrackpadTwoFingerFromRightEdgeSwipeGesture
```

To `system.defaults.dock` add:

```
showAppExposeGestureEnabled
showDesktopGestureEnabled
showLaunchpadGestureEnabled
showMissionControlGestureEnabled
```
2025-09-18 11:36:57 +10:00
Sam
ebd0bfc11f
defaults: add NSGlobalDomain.NSStatusItem{Spacing,SelectionPadding} (#1310)
Some checks failed
Test / test-stable (push) Has been cancelled
Test / install-against-stable (push) Has been cancelled
Test / install-flake (push) Has been cancelled
Update website / Build (push) Has been cancelled
Update website / Deploy (push) Has been cancelled
2025-09-17 09:55:40 +00:00
Maarten Staa
ac7999d72d Add NSStatusItemSpacing and NSStatusItemSelectionPadding
Add `NSStatusItemSpacing` and `NSStatusItemSelectionPadding` to `NSGlobalDomain`
options.

These options control the spacing between and padding inside status icons in the
menu bar. With these options, it's possible to squeeze more items on the menu
bar, something that's especially useful on machines with a notch.

This is a copy of #872, which was closed without being merged.

Co-Authored-By: Rob Harrop <rob@robharrop.dev>
2025-09-17 09:51:34 +02:00
Sam
8df64f8196
Application 'linking' done right (#1396) 2025-08-22 01:17:29 +00:00
Linnnus
423929a533 Escape XML generated by toPlist 2025-07-01 18:50:11 +02:00
ed9w2in6
44c5d10416 fix: prevent example of persistent-others from evaluating 2025-06-30 05:40:34 +08:00
ed9w2in6
5875113d74 feat: make persistent-others similar to the new persistent-apps
This is backward compatible via convertion function provided for
coercedTo.

Fixes: #968, #982, #1398
2025-06-30 05:40:34 +08:00
Sizhe Zhao
f2457a22c8
systems.defaults.alf: deprecate 2025-06-23 00:46:57 +08:00
Michael Hoang
be2d7d6535 applications: ensure sufficient permissions before updating apps 2025-06-21 14:54:32 +07:00
‮rekcäH nitraM‮
1f9cca7781 Copy applications instead of linking them to make macOS happy
All existing attempts fell short.
So we fall back to plain old copying applications over.

Problems with alternatives:

- Symlinking: Spotlight doesn't index symlinks. Therefore one cannot use
Spotlight to find or open the apps. Also they don't show up in
LaunchPad.

- Trampolines: Apples Security & Privacy doesn't get the concept and
shows them with the wrong name. Having an app open during an update will
also make it show up twice in the Dock.

- Aliasses: Require either AppleScript (a permission we don't want to
have, as it easily bypasses Apples TCC) or extra tools (that would be
ok), but also Aliasses are not categorized as 'Application' by
SpotLight.

- Directory Hardlinks are not supported by APFS - but also wouldn't work
cross volume.

- clonefile also doesn't work cross-volume.

Which all leads us back to Don Copine and Pastone. *sigh*
2025-06-21 14:54:32 +07:00
‮rekcäH nitraM‮
21d733a51f applications: reformat 2025-06-21 14:54:24 +07:00
Emily
72c88d5928
Avoid confusing users with future deprecations (#1499) 2025-06-12 14:47:19 +00:00
Sam
fa6120c32f
defaults: support AppleKeyboardUIMode = 2 for newer macOS versions (#1501) 2025-06-04 04:52:25 +00:00
Michael Hoang
f6b29e4af8 defaults: support AppleKeyboardUIMode = 2 for newer macOS versions 2025-06-04 11:02:16 +10:00
Ethan Turkeltaub
b07a4c8be5
Fix ShellCheck issue in nixPath check 2025-06-03 16:19:03 -04:00
Adam C. Stephens
7c284a6504
Avoid confusing users with future deprecations 2025-06-02 09:55:31 -04:00
Michael Hoang
cd6a8a796d config/system-path: restructure to mirror NixOS
2795c506fe/nixos/modules/config/system-path.nix
2025-05-25 14:06:56 +10:00
Robert Hensing
acf6b46011 system.build: Treat as variables, make lazy
This fixes an unnecessary evaluation dependency that prevented the
custom and much appreciated primaryUser error from popping up.

Specifically:

       … while evaluating the option `system.build':

       … while evaluating definitions from `/nix/store/lc6n4bhxj9255kzfn9pnpx65583a8cgc-source/modules/environment':

       … while evaluating definitions from `/nix/store/lc6n4bhxj9255kzfn9pnpx65583a8cgc-source/modules/nix':

       … while evaluating the option `environment.darwinConfig':

       … while evaluating the option `system.primaryUserHome':

       error: expected a string but found null: null
       at /nix/store/lc6n4bhxj9255kzfn9pnpx65583a8cgc-source/modules/system/primary-user.nix:26:30:
           25|       default =
           26|         config.users.users.${config.system.primaryUser}.home or "/Users/${config.system.primaryUser}";
             |                              ^
           27|     };

While it did have some indication as to the cause, it lets the good
error message go to waste.

**Context**

`lazyAttrsOf` is the better choice when you use an attrset as individual
variables instead of in aggregate (e.g. `attrNames`, `toJSON`).

The reason is that an expression like `a.b` is strict in `a`, which
entails the evaluating the _whole_ set of attribute _names_ in `a`.
In the `attrsOf` this means evaluating all `mkIf` conditions, which
in turn also means evaluating all the regular definitions to the
smallest degree (WHNF) to determine that they're not `mkIf`s.

`lazyAttrsOf` simply assumes that all attributes aren't `mkIf false`,
and throws an error in the attribute value if necessary.
This would be a problem with `toJSON` and such, but is completely
fine when the attributes are treated as variables of a lazy program,
as is the case here.

**NixOS**

NixOS made `system.build` a submodule with a `freeformType`, allowing
the things inside of it to be declared, and for them to have niceties
like documentation and merging behavior.
nix-darwin could probably adopt this.
2025-05-23 12:00:51 +02:00
Siddhartha Sahu
24952f03f9
Update default.nix 2025-05-17 12:15:49 -04:00
Siddhartha Sahu
a4cc54778d
Update repo link 2025-05-17 12:14:14 -04:00
Emily
a0e4dd2af9 activation-scripts: move createRun after checks
The checks should no longer depend on `/run`, so this avoids modifying
the system before they run.
2025-05-16 16:34:31 +01:00
Emily
7e5c6f7e21 etc: merge etcChecks into checks
The `activate-system` daemon will now run all the checks, which seems
like probably a good idea anyway?
2025-05-16 16:34:31 +01:00
Emily
af62c4d176 checks: make nixPath check more helpful 2025-05-16 16:34:31 +01:00
Emily
051283a895 {activation-scripts,activate-system}: purify environment again 2025-05-16 16:34:31 +01:00
Emily
2ca294741f activation-scripts: get rid of user activation
🎉

Closes: #96
2025-05-16 16:34:31 +01:00
Emily
bed70a84af {environment,nix}: remove references to $HOME
These can’t be relied upon in a post‐user‐activation
world. Technically a breaking change, if anyone has their home
directory outside of `/Users` or is using `root` for this, but, well,
I did my best and these are legacy defaults anyway.
2025-05-16 16:31:17 +01:00
Emily
2892da83ea applications: use system.primaryUser for the legacy path
System activation scripts shouldn’t (and soon won’t be able to)
rely on `$HOME` being the primary user’s.
2025-05-16 16:31:17 +01:00
Emily
f47b8062cb defaults: move userDefaults to system activation 2025-05-16 16:31:17 +01:00
Emily
7877cba5f5 launchd: move userLaunchd to system activation
I’m not *completely* certain that this handles user agents
correctly. There is a deprecated command, `launchctl asuser`, that
executes a command in the Mach bootstrap context of another user`.
<https://scriptingosx.com/2020/08/running-a-command-as-another-user/>
claims that this is required when loading and unloading user agents,
but I haven’t tested this. Our current launchd agent logic is pretty
weird and broken already anyway, so unless this actively regresses
things I’d lean towards keeping it like this until we can move
over entirely to `launchctl bootstrap`/`launchctl kickstart`, which
aren’t deprecated and can address individual users directly. Someone
should definitely test it more extensively than I have, though.
2025-05-16 16:29:17 +01:00
Emily
c449918bfb homebrew: move to system activation
This adds an optional explicit `homebrew.user` option that allows users
to avoid setting `system.primaryUser`, partly as a proof of concept
of what the interfaces should look like in the future. Homebrew only
officially support one global installation, so a singleton matches
upstream’s expectations; in practice, it may be useful for us to
nest this into `users.users.*.homebrew` instead, at the expense of
being an unsupported setup if used to its full potential. Since
that would be a breaking change to the inteface anyway, I think
adding `homebrew.user` for now is acceptable. (I think one native
Apple Silicon and one Rosetta 2 Homebrew installation – under
`/opt/homebrew` and `/usr/local` respectively – may be exceptions
to this lack of upstream support, but that would be complicated to
support even with `users.users.*.homebrew`.)

I’m not entirely sure where in system activation this should
go. Probably after the user defaults and launch agents stuff, to match
the existing logic in user activation, and I lean towards doing it
as late as possible; too early and we might not have the users and
groups required to bootstrap a Homebrew installation set up, but
as Homebrew installations could be fiddly and fail, doing it in the
middle could leave a partially‐activated system.

Probably it should be done in a launch agent or something instead, but
this is my best guess as to the appropriate place for now. The downside
is that activation scripts generally won’t be able to assume that the
Homebrew prefix is populated according to the current configuration,
but they probably shouldn’t be depending on that anyway?
2025-05-16 16:29:17 +01:00
Emily
52ee8c57c2 primary-user: init 2025-05-16 16:29:17 +01:00
Michael Hoang
14737a9676 defaults: add com.apple.iCal for managing Calendar.app 2025-05-16 12:52:49 +10:00
Michael Hoang
d693997a32 defaults: update docs for AppleInterfaceStyle
Eventually we should implement a special type that allows deleting
values.
2025-05-15 18:02:47 +10:00
Emily
ce5a3b9db9 treewide: point to the new GitHub organization 2025-03-27 17:07:57 +00:00
Emily
e9f41de2a8
Merge pull request #1375 from dwt/fix-docs-2
Docs: Fix references to NixOS
2025-03-21 22:10:55 +00:00
Zhaofeng Li
814b503899 Fix merging of system.defaults.CustomUserPreferences 2025-03-14 12:00:17 -06:00
‮rekcäH nitraM‮
d97323bc60 Docs: Fix references to NixOS
This option applies to nix-darwin.
2025-03-06 16:24:46 +01:00
Austin Horstman
e21d07988b
dock: refactor persistent-apps option 2025-02-17 13:12:40 -06:00
Austin Horstman
02ba211ea1
dock: allow setting tile-types
You can create spacer tiles in the dock by passing empty tile-data with
specific tile-types
2025-02-16 19:26:43 -06:00
Emily
731910af01 {activation-scripts,activate-system}: check gcroots before linking
When `nix.enable` is off, we don’t necessarily have an active
Nix installation, so there won’t necessarily be an active
`/nix/var/nix/gcroots` directory to link things into. NixOS just skips
this unconditionally when `nix.enable` is off, but that doesn’t
work well with a context in which we usually expect `nix.enable`
to be coupled with an unmanaged system installation of Nix.
2025-02-11 20:10:55 +00:00
Emily
a6746213b1
Merge pull request #1313 from emilazy/push-tzwxwyvonslk
nix: add `nix.enable` option to disable Nix management
2025-02-11 19:30:41 +00:00
Emily
3f4351d233
Merge pull request #1327 from emilazy/push-vunnqlmqnzts
checks: fix macOS version check exit code
2025-02-08 14:32:00 +00:00
Emily
03877755e9 checks: add check for Determinate
This provides a more useful error message than the `/etc/nix/nix.conf`
hash mismatch error that would otherwise occur.
2025-02-07 20:08:26 +00:00