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

262 commits

Author SHA1 Message Date
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
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
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