Commit graph

1449 commits

Author SHA1 Message Date
Nathan Henrie
349b2c66a9 apply should return null if the argument is not a list
Fixes https://github.com/nix-darwin/nix-darwin/issues/1578
2025-09-04 13:34:55 -06:00
Sam
8df64f8196
Application 'linking' done right (#1396) 2025-08-22 01:17:29 +00:00
Sam
3a0a38a1e7
launchd+defaults: Escape XML generated by toPlist (#1529) 2025-08-21 04:49:33 +00:00
Elliot
6f24595362
fish: add shellAbbrs config
Co-authored-by: Sam <30577766+Samasaur1@users.noreply.github.com>
2025-08-14 14:56:43 +08:00
Linnnus
f0b44d6854 Add eval warning 2025-08-09 17:39:49 +02:00
Linnnus
66911b7d16 Remove manual escaping 2025-07-01 21:04:57 +02:00
Linnnus
423929a533 Escape XML generated by toPlist 2025-07-01 18:50:11 +02:00
Tom McLaughlin
7f9694a4be github-runner/service.nix: fix missing argument in workDir assertion 2025-06-29 13:43:52 -07:00
Sam
1dd19f19e4
nix.nixPath: Do not use environment.darwinConfig if set to null (#1469) 2025-06-22 18:56:08 +00:00
Sizhe Zhao
f2457a22c8
systems.defaults.alf: deprecate 2025-06-23 00:46:57 +08:00
Sizhe Zhao
caa59bf50a
networking.applicationFirewall: init 2025-06-23 00:46:57 +08:00
Sam
04a3412801
homebrew: allow setting greedy for all casks by default (#1382) 2025-06-22 06:00:51 +00:00
Michael Hoang
ff139e8183
Remove deprecated homebrew tap example (homebrew/cask-fonts) (#1515) 2025-06-22 02:18:14 +00: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
Michael Hoang
0d71cbf88d
programs/ssh: backport knownHosts changes (#1517) 2025-06-19 09:27:36 +00:00
Michael Hoang
82566dd254 programs/ssh: remove with lib; 2025-06-19 16:08:37 +07:00
Michael Hoang
a991859d1f nixos/ssh: undeprecate knownHosts.«name».hostNames
Backport e9f17a9f45

Co-authored-by: pennae <github@quasiparticle.net>
2025-06-19 16:08:09 +07:00
Michael Hoang
9d5b27bc93 modules/programs/ssh: knownHosts -> extraKnownHosts
Backport 8fa2e787f1

Co-authored-by: Taeer Bar-Yam <taeer@bar-yam.me>
2025-06-19 16:07:11 +07:00
Michael Hoang
2d257c09a1 programs.ssh.knownHosts: update example to be an attrset
Backport 4f11c06fac

Co-authored-by: Florian Klink <flokli@flokli.de>
2025-06-19 16:05:09 +07:00
Michael Hoang
04b04f4b9d programs/ssh: move to match path in NixOS 2025-06-19 10:45:32 +07:00
Garrett Hopper
f67a4856c3 Update homebrew module documentation and examples
- Replace deprecated homebrew/cask-fonts with apple/apple tap example
- Update documentation links from archived homebrew-bundle to brew.sh/Brew-Bundle-and-Brewfile
- Update source file references to new location in main brew repository
2025-06-17 05:52:35 -05:00
Brian Romanko
0721726e21
Wrap the call with env 2025-06-13 16:49:58 -07:00
Brian Romanko
300af6fcc5
Preserve PATH variable when using sudo
Some systems set `secure_path` in sudoers. When this is set
the `PATH` variable is not set in the sudo environment. Using
`--preserve-env=PATH` ensures that the PATH env var is set properly
in those systems.

This is similar to the issue with [darwin-rebuild](https://github.com/nix-darwin/nix-darwin/issues/798)
not working with sudo on these systems.
2025-06-13 16:49:57 -07:00
Emily
72c88d5928
Avoid confusing users with future deprecations (#1499) 2025-06-12 14:47:19 +00:00
Sam
63c31af37a
etc: add known hashes for zprofile and zshrc in macOS 26 beta 1
This also includes versions of /etc/zshrc with both the official and
DeterminateSystems installers.
2025-06-11 01:43:35 -07:00
Sam
19346808c4
programs/direnv: fix silent option (#1491) 2025-06-06 07:19:53 +00:00
Duc Nghiem-Xuan
daf8e22831 programs/direnv: add finalPackage readonly option 2025-06-06 15:49:37 +09:00
Sam
9753a8706b
feat: add option programs.zsh.enableAutosuggestions (#1433) 2025-06-06 06:02:11 +00:00
Duc Nghiem-Xuan
fb27326bbc programs/direnv: fix silent option 2025-06-05 17:49:17 +09: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
Michael Hoang
5374405a01 config/terminfo: init module 2025-05-25 09:24:12 +10:00
Michael Hoang
7347f72507 programs/arqbackup: init module 2025-05-24 15:16:24 +10:00
Robert Hensing
30845beee0 nix.nixPath: Do not use environment.darwinConfig if set to null
I've personally set it to `null` to make my `system.primaryUser = null;`
configuration work on a machine with `stateVersion = 4;`.

It may apply in other use cases as well.
2025-05-23 16:51:36 +02: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
squat
e09c1aefe4
feat(services.openssh): add extraConfig option
Same interface as in NixOS: https://search.nixos.org/options?channel=unstable&show=services.openssh.extraConfig&from=0&size=50&sort=relevance&type=packages&query=services.openssh.extraConfig
This is useful to customize the behavior of the SSH daemon, e.g. to add
options like `StreamLocalBindUnlink yes` to improve gpg-agent
forwarding.

Signed-off-by: squat <lserven@gmail.com>
2025-05-22 20:22:47 +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
0abf012666 users: refuse to delete the primary user 2025-05-16 16:31:17 +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