1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00
Commit graph

334 commits

Author SHA1 Message Date
Malo Bourgon
398510f601 Add nix.optimise module 2024-03-27 12:50:04 -07:00
Dylan Frankland
5c65cfb656 Add support for persistent-apps in dock 2024-03-03 21:32:17 -08:00
Dylan Frankland
b620e32a76 fix writing values with containers
Complex container values like `-array` have their own DSL which does not
allow specifying all data types. Instead of using the DSL use plist
fragments instead.
2024-03-02 22:29:56 -08:00
Michael Hoang
8a15cb36ff
Merge pull request #892 from Samasaur1/startup-chime
`system.startup.chime`: init
2024-03-02 13:57:42 +11:00
Sam
ee53e5785c
system.startup.chime: init 2024-02-29 22:23:40 -08:00
Sam
0363c18c37
system.nvram: init (internal) 2024-02-29 22:20:04 -08:00
Moritz Rumpf
ad98aebc0f Fix doc render problem
This fixes:
```
RuntimeError: can't render html in the presence of docbook
```
2024-02-29 08:45:54 +01:00
Moritz Rumpf
2ffb75f942 defaults: Add options for dragOnGesture feature
This is just a rebased version of https://github.com/LnL7/nix-darwin/pull/513

Credit to @2gn
2024-02-29 08:45:54 +01:00
Michael Hoang
0dd382b70c
Merge pull request #820 from mhumeSF/reduce-motion
Add `universalaccess.reduceMotion` option
2024-01-03 10:28:40 +00:00
Austin Horstman
f6cf46f7bc
GlobalPreferences: fix mouse scaling example 2023-12-29 14:09:38 -06:00
fortuneteller2k
9acb5b1adc Use native floats for mouse scaling 2023-12-27 11:30:04 +08:00
Michael Hoang
850eabce44 etc: add known hash for /etc/shells 2023-12-23 22:41:58 +11:00
Mike Hume
6c40798934 Adding reduce motion option 2023-12-01 15:10:10 -05:00
Felix Scheinost
39a412d47d Fix unbound variable etcProblems
I have another activationScript which traps errors. Currently `etcProblems` can be unbound.
2023-11-09 12:44:10 +01:00
Domen Kožar
8caf3af927
Create $out/darwin-version
This fixes backwards compatibility with code that expects it.
2023-09-19 09:54:27 +01:00
zowoq
b671517f28 finder: types.string -> types.str
`string` was changed from deprecation warning to error in c59c6b1c57
2023-08-10 13:46:47 +10:00
Michael Hoang
a96987cef4
Merge pull request #713 from pik694/master
Dock icon magnification settings
2023-07-26 09:44:43 +10:00
Piotr Żelazko
7ff10017ed
chore: apply CR suggestions 2023-07-25 18:40:30 +02:00
Piotr Żelazko
640331dfba docs: add magnification values range 2023-07-24 21:16:04 +02:00
Michael Hoang
0f9058e739
Merge pull request #733 from Enzime/version
Add `darwin-version` command
2023-07-23 18:16:13 +10:00
Emily
4eb1c549a9 etc: check for existing files during checks stage
This ensures that activation fails early if there are any `/etc` files
with unexpected state, rather than leaving the system half-activated.
2023-07-16 12:15:07 +01:00
Emily
c91c351943 etc: rename activation script variables 2023-07-16 12:13:27 +01:00
Michael Hoang
0dafe2170d Add darwin-version command 2023-07-14 23:06:46 +10:00
Michael Hoang
63af129cb5 etc: use .before-nix-darwin instead of .orig 2023-07-12 08:35:36 +10:00
Michael Hoang
cad8954f75 etc: fail if we can't add a file
Fixes #598
2023-07-11 18:59:05 +10:00
Michael Hoang
22620845fe readme: update with new flaky instructions 2023-07-11 18:59:05 +10:00
Michael Hoang
5288a72354 Allow flaky installation with darwin-rebuild 2023-07-11 18:59:05 +10:00
Marco Rebhan
b70656affa Add system.systemBuilderCommands and systemBuilderArgs
These are the equivalents of the
NixOS options with the same name, introduced in
d3ac0938a7.
Allows running extra commands while building the system configuration
output, for example to add extra files into the output directory,
and passing arguments to the system builder's mkDerivation.
2023-07-10 16:05:55 +02:00
Emily
f9724c4543 eval-config: rationalize handling of Nixpkgs
This is a big change that disentangles a lot of mistaken assumptions
about mixing multiple versions of Nixpkgs, treating external flake
inputs as gospel for the source of Nixpkgs and nix-darwin, etc.;
the end result should be much simpler conceptually, but it will be a
breaking change for anyone using `eval-config.nix` directly. Hopefully
that shouldn't be a big issue, as it is more of an internal API and
it's quite likely that existing uses may have been broken in the same
way the internal ones were.

It was previously easy to get into a state where your `lib` comes
from nix-darwin's `nixpkgs` input or a global channel and your
`pkgs` comes from another major version of Nixpkgs. This is pretty
fundamentally broken due to the coupling of `pkgs` to its corresponding
`lib`, but the brokenness was hidden much of the time until something
surfaced it. Now there is exactly one mandatory `lib` input to system
evaluation, and the handling of various additional options like `pkgs`
and `system` can be done modularly; maintaining backwards compatibility
with the previous calling convention is punted to the `default.nix`
and `lib.darwinSystem` entry points. `inputs` is no longer read by
nix-darwin or special in any way, merely a convention for user code,
and the argument is retained in the entry points only for backwards
compatibility.

All correct invocations of the entry points should keep working
after this change, and some previously-broken ones should be fixed
too. The documentation and template have been adjusted to show the
newly-recommended modular way of specifying various things, but no
deprecation warnings have been introduced yet by this change.

There is one potential, mostly cosmetic regression:
`system.nixpkgsRevision` and related options are less likely to be
set than before, in cases where it is not possible to determine the
origin of the package set. Setting `nixpkgs.source` explicitly will
make this work again, and I hope to look into sending changes upstream
to Nixpkgs to make `lib.trivial.revisionWithDefault` behave properly
under flakes, which would fix this regression and potentially allow
reducing some of the complexity.

Fixes: #669
2023-07-09 11:21:40 +01:00
Emily
51ba5e614a version: rewrite Git revision logic
We trust the version information from `nixpkgs.source` when `pkgs` was
constructed by the `nixpkgs` module or `nixpkgs.source` was explicitly
set by the configuration. Otherwise, we rely on Nixpkgs to report its
own version, which handles the same cases as the old logic and opens
the door to Nixpkgs automatically reporting the correct revision when
using flakes.
2023-07-09 07:26:23 +01:00
Emily
72b7e8668c version: default Git revision options to null
This allows for more uniform handling in the documentation generator,
and avoids lying about the Git reference being `master` internally.
2023-07-09 07:26:00 +01:00
Piotr Żelazko
8c1c48c87a
feat: add dock icon magnification settings 2023-06-27 16:44:16 +02:00
Emily
e65131e69c treewide: convert all option docs to Markdown
This process was automated by [my fork of `nix-doc-munge`]; thanks
to @pennae for writing this tool! It automatically checks that the
resulting documentation doesn't change, although my fork loosens
this a little to ignore some irrelevant whitespace and typographical
differences.

As of this commit there is no DocBook remaining in the options
documentation.

You can play along at home if you want to reproduce this commit:

    $ NIX_PATH=nixpkgs=flake:nixpkgs/c1bca7fe84c646cfd4ebf3482c0e6317a0b13f22 \
      nix shell nixpkgs#coreutils \
      -c find . -name '*.nix' \
      -exec nix run github:emilazy/nix-doc-munge/0a7190f600027bf7baf6cb7139e4d69ac2f51062 \
      {} +

[my fork of `nix-doc-munge`]: https://github.com/emilazy/nix-doc-munge
2023-06-24 10:48:55 +01:00
Emily
efe314cdba treewide: manually convert some docs to Markdown
These all use DocBook markup too complex for `nix-doc-munge` to handle,
have syntax that clashes with Markdown, or already contain Markdown
syntax that currently isn't rendering correctly.

Converting DocBook list syntax makes me think that maybe Markdown
isn't so bad after all.
2023-06-24 10:48:55 +01:00
Emily
b97c235e37 treewide: tweak DocBook docs for conversion
These help `nix-munge-doc` automate more of the Markdown conversion
process. See the following nixpkgs commits for explanations of many
of these changes:

* 275a34e0d8
* 694d5b19d3
* f1d39b6d61
* 16102dce2f

I couldn't think of any particularly good way to format the
`system.defaults` breadcrumbs, so I just made them standalone
paragraphs. They weren't rendering correctly in DocBook anyway.
2023-06-24 10:48:55 +01:00
zowoq
fbb3ab94e6 activity monitor: change settings to null
treewide these seem to be the only settings that aren't unset by default which seems inconsistent
2023-06-23 20:29:46 +10:00
Daiderd Jordan
ed275afbba
Merge pull request #671 from sxyazi/pr-e0f2168d
Add `mouseDriverCursorSize` option
2023-06-20 21:55:53 +02:00
Daiderd Jordan
050da23813
Merge pull request #672 from sxyazi/pr-af01ed5d
Add `AppleScrollerPagingBehavior` option
2023-06-20 21:55:28 +02:00
Daiderd Jordan
689aa795a1
Merge pull request #673 from sxyazi/pr-4df4da65
feat: add `AppleWindowTabbingMode` option
2023-06-20 21:52:47 +02:00
Cole Helbling
9c7a07b8b2
system/checks: allow disabling the buildUsers check
This allows systems with auto-allocate-uids enabled to work (by
disabling this check).
2023-06-06 16:21:14 -07:00
John Soo
add08fcab0 flakes: Do not verify channels when using flakes. 2023-05-31 07:28:23 -06:00
sxyazi
cfcfcc535e
feat: use enum instead of str for constraints nicer 2023-05-27 01:42:42 +08:00
sxyazi
df00ca18a3
feat: add AppleWindowTabbingMode option 2023-05-27 01:37:34 +08:00
sxyazi
ce785ccacf
feat: add AppleScrollerPagingBehavior option 2023-05-27 01:02:23 +08:00
sxyazi
7bf15660ca
fix: type 2023-05-27 00:37:51 +08:00
sxyazi
0ad226e8c3
feat: add mouseDriverCursorSize option 2023-05-27 00:13:47 +08:00
Daiderd Jordan
b8c286c82c
Merge pull request #616 from gshpychka/patch-1
feat: support writing arrays to system defaults
2023-05-22 19:02:28 +02:00
Hraban Luyat
f1a562eef1 refactor: rename clock option menuExtraClock 2023-05-15 13:44:02 -04:00
Hraban Luyat
f6b7489ddb feat: defaults write com.apple.menuextra.clock 2023-05-15 13:13:18 -04:00
Domen Kožar
0dbf1c2fb1
Merge pull request #654 from shivaraj-bh/authorized-keys
Manage SSH authorized keys for users
2023-05-15 11:59:31 +01:00
Daiderd Jordan
252541bd05
Merge pull request #638 from aerialls/screensaver
feat(screensaver): add support of askForPassword and askForPasswordDelay
2023-05-10 23:42:22 +02:00
sbh69840
ccaa942888 don't check knownSha256 for authorized_keys files 2023-05-10 20:03:21 +05:30
sbh69840
64a15676ac support authorized_keys for users 2023-05-10 19:28:00 +05:30
Julien Brochet
2303eed571
feat(screensaver): add support of askForPassword and askForPasswordDelay 2023-04-30 14:11:40 +02:00
Glib Shpychka
9f93b19585
feat: support writing arrays to system defaults 2023-03-14 14:50:10 +02:00
Marwan Aljubeh
ca62d93c6c
Only use --force for patches applied in reverse
Using `--forward` already instructs `--patch` to ignore patches that it thinks are reversed or already applied.
2023-03-07 13:37:18 +00:00
Marwan Aljubeh
42e0e4f3b4
Add --force to all patch invocations 2023-03-07 13:35:24 +00:00
Marwan Aljubeh
e62b83a934
Fix system.patches
Currently, `system.patches` doesn't work because it will attempt to first detect if the patch has already been applied by checking if it can be applied in reverse.

However, when that happens, `patch` detects that the supplied patch is incorrectly reversed and attempts to ask the user if they want to "Ignore -R":

```
Unreversed (or previously applied) patch detected!  Ignore -R? [y]
```

Because the output is piped to `/dev/null` the user will basically see nothing and `darwin-rebuild switch` will hang until the user presses "Enter" (possibly to check if the terminal is frozen). At which point, patch will ignore the --reverse and exit successfully, preventing the patch from being applied at all.

This change fixes that bug by using `--force` which tells patch that we know what we're doing and prevents it from prompting the user if they want to ignore `--reverse`.
2023-03-07 12:53:20 +00:00
Domen Kožar
adb8ac0453
Merge pull request #452 from psm14/mouse-scaling
add mouse scaling system setting
2022-12-16 13:07:17 +00:00
Slim Lim
6774344719 Add option to set 24-hour time
Normally, the system region setting determines whether the clock uses
12- or 24-hour time. This flag allows users to override this setting and
use 24-hour time even if their region does not.
2022-12-13 15:42:25 -08:00
Domen Kožar
21791d4c01
Merge pull request #470 from toonn/berbiche-fix-applications-symlink
Disable taking control of ~/Applications folder MkII
2022-11-01 09:17:24 +00:00
Pavel Shirshov
c946ee42fa #517: custom preferences for 'defaults' can be specified 2022-10-24 13:12:54 +01:00
James Walker
a2a9f30fee
rename runCommandNoCC 2022-09-25 14:12:08 -04:00
Domen Kožar
b3de9dded8
Merge pull request #228 from malob/sudo-touchid
Add option to enable sudo authentication with Touch ID
2022-09-20 13:42:31 +01:00
toonn
ed1e73d01e
applications: Drop store prefix to generalize
While the Nix store is almost always at `/nix/store`, we shouldn't
assume it to be. Checking only the trailing part of the link is less
exact but removes this bad assumption.

I also added a check for the symlink's contents when overwriting it to
more accurately check whether we own it and should replace it.
2022-09-13 14:57:50 +02:00
toonn
fbe795f39d
applications: Symlink Nix Apps to /Applications
This PR supercedes #226.

So far application bundles were always linked to `~/Applications` or
`~/Applications/Nix Apps` if the former was an existing directory.

In nix-community/home-manager#1341 a conflict was found with suggested
new Home Manager behavior, where applications installed through Home
Manager would end up in `~/Applications/Home Manager Apps`. This was in
an attempt to make them discoverable through Spotlight but further
investigation suggest Spotlight does not pick up symlinked apps (details
in the issue).

However, there are other programs that expect to be able to write to
`~/Applications` so taking over the directory is unfortunate.

PR #226 dropped linking `~/Applications` and instead made sure the
directory exists so we can always link in `~/Applications/Nix Apps`.

After further discussion in #macos:nixos.org we came to the conclusion
that we shouldn't link applications to a user directory at all. Since we
manage packages for multiple users, application bundles should go in
`/Applications`.

Because previous code will likely leave a symlink at
`~/Applications/{,Nix Apps}`, which will become dangling once the path
it links to is garbage collected from the store we test to see if a link
exists and it conforms to the path we're expecting and if it does remove
it.
2022-09-13 14:57:46 +02:00
Nicolas Berbiche
9c76fbf20f
Disable taking control of ~/Applications folder
Programs like Steam add applications to ~/Applications and such.

This commit disables linking ~/Applications to nix-darwin Applications
in the /nix/store and makes nix-darwin use a subfolder within
~/Applications.
2022-09-13 14:57:46 +02:00
Malo Bourgon
5fa362c32f Transition to using native floats 2022-08-29 15:39:16 -07:00
Domen Kožar
5af1aa51f6
Merge pull request #490 from malob/update-nix-module
Bring `nix` module back in sync with the NixOS module (as much as possible)
2022-08-22 09:55:24 +02:00
Jan Schmitt
fbca12e524
feat: provide option to display the appswitcher on all displays 2022-08-20 22:48:59 +02:00
Malo Bourgon
ffc8ec5c9a Add .nix-defexpr to NIX_PATH the way the NixOS module does 2022-08-16 17:41:08 -07:00
Malo Bourgon
7e74c1c9fb Move build user options to nix module to improve overlap with NixOS
Also add `config.ids` like in NixOS.
2022-08-16 10:41:51 -07:00
Pat McLaughlin
c82b2327e5 add mouse scaling system setting 2022-08-06 11:19:25 -04:00
Daniel Santa Cruz
2c6b9d9144 Add option to set com.apple.screencapture type 2022-07-12 14:50:50 -06:00
Malo Bourgon
ca57e8bcdb Change option name and switch to using activation script 2022-06-30 13:32:46 -07:00
Malo Bourgon
1d98da837f Add option to enable sudo authentication with TouchID 2022-06-30 13:31:42 -07:00
Daiderd Jordan
1a387b8b3e
Merge pull request #447 from dsyang/additional-options
add options for configuring activity monitor
2022-04-25 23:03:55 +02:00
Matthew Toohey
a4f5ff411e Fix synthetic.conf instructions 2022-04-14 20:07:28 -04:00
Domen Kožar
8a1a454873
Merge pull request #450 from midchildan/fix/fxpreferredviewstyle
fix: incorrect default for FXPreferredViewStyle
2022-03-26 07:08:58 +00:00
Brian Leung
af3eb87e82
Add NSGlobalDomain.NSAutomaticWindowAnimationsEnabled setting
* modules/system/defaults/NSGlobalDomain.nix: Define.
2022-03-25 23:04:45 -07:00
midchildan
f6161c1ed8
fix: incorrect default for FXPreferredViewStyle 2022-03-25 00:37:17 +09:00
Dan Yang
faaa12ad24 add options for configuring activity monitor 2022-03-14 10:17:35 -07:00
Dan Yang
37e42a9fe4 add option to show hidden files everywhere 2022-03-14 10:04:28 -07:00
Dan Yang
d61d8b3bd0 additional finder options 2022-03-10 00:43:27 -08:00
Dan Yang
d1c5344222 option to show all hidden files 2022-03-10 00:12:30 -08:00
Daiderd Jordan
af65e183c3
Merge pull request #419 from tboerger/dock-features
modules/system/defaults/dock.nix: add options for hot corners
2022-01-17 21:57:10 +01:00
Thomas Boerger
4c243ea8c8
modules/system/defaults/dock.nix: make sure to use positive ints for hot corners 2022-01-17 00:33:29 +01:00
Thomas Boerger
d053e8ade5
modules/system/defaults/dock.nix: add options for hot corners 2022-01-17 00:33:29 +01:00
Chris Montgomery
1cf5705283
defaults: add options for common universalaccess settings 2021-12-24 17:52:17 -05:00
Chris Montgomery
7709d31d76
defaults-write: sort variables and lists by name and option 2021-12-24 17:29:44 -05:00
Chris Montgomery
f07acb443a
defaults-write: formatting 2021-12-24 17:20:15 -05:00
Daiderd Jordan
44da835ac4
add forward compatibility for literalExample deprecation
Fixes #367
2021-10-23 15:06:42 +02:00
cherryblossom000
99ff0b66ca
Fix some typos 2021-10-21 20:37:43 +11:00
Daiderd Jordan
f3c3b8db6e
Merge pull request #351 from nosewings/master
system.defaults: enable automatic light/dark mode
2021-09-14 18:53:17 +02:00
Jason Felice
998fbfc039 defaults: magic mouse option 2021-08-24 17:13:48 -04:00
Nicholas Coltharp
7a3f541d5c system.defaults: enable automatic light/dark mode 2021-08-06 18:43:03 -05:00
Jean-Francois Chevrette
db933d1d41
change inner double quotes to single quotes 2021-05-12 17:47:29 -04:00
Daiderd Jordan
5c3146b75d
users: migrate nixbld -> _nixbld
According to some investigation creating "role" accounts avoids
migration problems when upgrading to certain macOS versions, so create
the build users to match that definition and remove the old ones if
present.

    Role accounts require name starting with _ and UID in 200-400 range
2021-02-17 22:04:54 +01:00
Daiderd Jordan
3b28c4675a
Merge pull request #262 from malob/brew-bundle
Add Homebrew Bundle module
2021-02-17 18:46:15 +01:00
Daiderd Jordan
3cf11923eb
use --dry-run check to re-apply system patches 2020-12-19 11:56:51 +01:00