1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-06 08:47:00 +00:00
Commit graph

2031 commits

Author SHA1 Message Date
Emily
962eb3f1c0 nixpkgs: assert that nixpkgs.config is not set when pkgs is passed in externally
This is a common footgun people hit often. Remove it.

Backport of Nixpkgs commit ce87196a00214a0062ece1c3e03a9a97f563580f.

Co-authored-by: K900 <me@0upti.me>
2025-02-03 20:25:16 +00:00
Emily
5b0cffeec2 nixpkgs: fix undefined variable in assertion
This got mangled in the backport a year and a half ago.

Fixes: e25eeff158
2025-02-03 20:25:16 +00:00
Emily
49b807fa7c
Merge pull request #1311 from tarc/master
checks: fix sw_vers parameter for macOSVersion
2025-01-30 22:55:53 +00:00
tarc
f1cf8c4f5a checks: fix sw_vers parameter for macOSVersion (--productVersion, not -productVersion) 2025-01-30 12:46:25 -03:00
Michael Hoang
349a74c66c
Merge pull request #1306 from emilazy/push-kzsqtpuplusw
Revert "{activation-scripts,activate-system}: purify environment"
2025-01-28 09:58:58 +07:00
Emily
cc9c8408bb Revert "{activation-scripts,activate-system}: purify environment"
This shouldn’t actually be split out from the Plan because of the
current use of `$HOME` in the defaults for channel‐based setups.

This reverts commit 4bff4bc8ae.
2025-01-28 02:31:59 +00:00
Emily
f43dac477e
Merge pull request #1280 from emilazy/push-tunoqoxyyuvy
{environment,readme}: default configuration path to `/etc/nix-darwin`
2025-01-28 02:14:28 +00:00
Emily
5c12a6f4a1
Merge pull request #1303 from emilazy/push-ulxuwyrnkwpq
{activation-scripts,activate-system}: purify environment
2025-01-27 23:11:51 +00:00
Emily
3509925a86 readme: make darwin-rebuild use more explicit 2025-01-27 23:10:14 +00:00
Emily
2733527a58 {environment,readme}: default configuration path to /etc/nix-darwin 2025-01-27 23:10:14 +00:00
Emily
5bc4677c03 readme: reduce duplication in installation instructions 2025-01-27 22:38:26 +00:00
Emily
6715348399
Merge pull request #1300 from emilazy/push-knuxyuxwswlu
ci: use the PR head as `<darwin>` for install test
2025-01-27 22:38:02 +00:00
Emily
67e7728c9a
Merge pull request #1302 from emilazy/push-vtlomuzppvtu
checks: remove `darwinChanges`
2025-01-27 22:35:28 +00:00
Emily
4bff4bc8ae {activation-scripts,activate-system}: purify environment
This ensures that system activation does not depend on various
details of its process environment, ensuring uniformity across various
invocation contexts and with the `activate-system` daemon. This becomes
more important in a post‐user‐activation world to avoid problematic
dependencies like `$SUDO_USER`, but is a good idea in general.

The `sudoers(5)` defaults on my Sequoia system are:

    Defaults	env_reset
    Defaults	env_keep += "BLOCKSIZE"
    Defaults	env_keep += "COLORFGBG COLORTERM"
    Defaults	env_keep += "__CF_USER_TEXT_ENCODING"
    Defaults	env_keep += "CHARSET LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE"
    Defaults	env_keep += "LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME"
    Defaults	env_keep += "LINES COLUMNS"
    Defaults	env_keep += "LSCOLORS"
    Defaults	env_keep += "SSH_AUTH_SOCK"
    Defaults	env_keep += "TZ"
    Defaults	env_keep += "DISPLAY XAUTHORIZATION XAUTHORITY"
    Defaults	env_keep += "EDITOR VISUAL"
    Defaults	env_keep += "HOME MAIL"

Of these preserved environment variables, the ones that are set in
practice when I run `sudo env` that aren’t set in the activation
script here are:

* `$COLORTERM`
* `$DISPLAY`
* `$EDITOR`
* `$MAIL`
* `$SSH_AUTH_SOCK`
* `$TERM`
* `$__CF_USER_TEXT_ENCODING`

Most of these seem either pointless or actively harmful to set for
the purpose of the system activation script.

This will mean that tools run during activation won’t print output
in the user’s preferred language, but that’s probably the right
trade‐off overall, as that is likely to break activation scripts
that parse command output anyway.
2025-01-27 22:31:15 +00:00
Emily
ff80eacd0f activation-scripts: remove _status
I believe this has been obsolete since `set -e` was added in
8708ebb796.
2025-01-27 22:31:15 +00:00
Emily
0e87d3d391 activate-system: don’t KeepAlive
It seems like a bad idea to keep restarting the activation daemon
when it fails.
2025-01-27 22:31:15 +00:00
Emily
2119dd10f6 checks: remove darwinChanges
It seems like this has been broken since
26bab2fd32 from 2018; macOS `diff(1)`
does not support these arguments and the `$PATH` has been fixed since
that point. Before that, it would presumably only have worked if you
added GNU diffutils to `environment.systemPackages`.

Proactively notifying users about breaking changes isn’t a bad idea,
but the activation script doesn’t seem like the right place for it,
and as it’s non‐blocking it’s likely that even if it worked it
would get drowned out by the later output anyway. I’d like to move
the changelog into release notes as part of the manual, which would
requires changes to this anyway. Since it’s been broken for almost
seven years anyway, let’s just drop it for now and revisit later.
2025-01-27 20:59:20 +00:00
Emily
1e16e2a9c2 ci: use the PR head as <darwin> for install test
This was installing against the base branch, which causes annoying
issues when things like the state version are bumped. It’s possible
this was intentional to test the upgrade path, but it’s inconsistent
with the flake installation test and keeps breaking stuff on my
PRs. If we want to test the upgrade path then we could re‐add it
again later in a more sophisticated manner (e.g. using the example
config from the previous version).
2025-01-27 20:04:09 +00:00
Emily
62ba0a2242
Merge pull request #1282 from emilazy/push-uqnyoyklywvo
nix-tools: drop `nixPackage`, overwrite `$PATH` rather than prepending, set `$NIX_PATH`
2025-01-26 21:26:41 +00:00
Emily
65cc1fa8e3
Merge pull request #1283 from emilazy/push-nynpmzrmmozu
checks: remove `runLink`
2025-01-22 00:01:16 +00:00
Emily
46d0fa4ded
Merge pull request #1279 from emilazy/push-tstmztlwwouo
darwin-uninstaller: remove `darwin` channel from `root` too
2025-01-21 01:33:50 +00:00
Emily
3cdacf160b
Merge pull request #1281 from emilazy/push-ozqwkmtmkvtr
darwin-rebuild: pass `${extraBuildFlags[@]}` to `nix-instantiate`
2025-01-21 01:33:15 +00:00
Emily
9525191e9f
Merge pull request #1278 from emilazy/push-vuuzmmsrorvw
system: tweak ShellCheck settings
2025-01-21 01:33:00 +00:00
Emily
74a58bfb3f
Merge pull request #1290 from emilazy/push-rzokwryxsqxz
eval-config: omit `enableNixpkgsReleaseCheck` from `lib.evalModules`
2025-01-21 00:55:11 +00:00
Emily
87b61d6666 eval-config: omit enableNixpkgsReleaseCheck from lib.evalModules 2025-01-21 00:27:49 +00:00
Emily
b5b7888793 nix-tools: set $NIX_PATH
This will be important once most users are running `sudo
darwin-rebuild` and therefore not getting their environment’s
`$NIX_PATH` passed through.
2025-01-20 05:29:44 +00:00
Emily
4d0ae6980d nix-tools: overwrite $PATH rather than prepending
I don’t see any reason for these scripts to depend on more
environmental state than necessary.
2025-01-20 05:29:44 +00:00
Emily
c3954c51c4 checks: remove runLink
Now that we create `/run` as part of activation, this is no longer
useful for anaything.
2025-01-18 23:15:41 +00:00
Emily
3d95b01351 nix-tools: make systemPath more readable 2025-01-18 20:33:10 +00:00
Emily
02232f71c5 nix-tools: drop nixPackage
We already put `/nix/var/nix/profiles/default/bin` on the `$PATH`,
and whatever `nix.package` is set to already gets installed into
`/run/current-system/sw/bin`, so this is pointless.
2025-01-18 20:31:54 +00:00
Emily
5665d6c05e darwin-rebuild: pass ${extraBuildFlags[@]} to nix-instantiate
Theoretically required for `darwin-rebuild edit -I darwin-config=…`,
I guess. We also shouldn’t run it for flake‐based setups.
2025-01-18 20:01:22 +00:00
Emily
94adbd6259 darwin-uninstaller: remove darwin channel from root too 2025-01-18 19:38:34 +00:00
Emily
e1976612f0 system: tweak ShellCheck settings 2025-01-18 19:34:21 +00:00
Emily
87131f51f8
Merge pull request #1266 from emilazy/push-qwtkyltnunqn
checks: check `/etc/nix/nix.custom.conf` hash
2025-01-18 01:12:15 +00:00
Emily
3924b55553
Merge pull request #1277 from emilazy/push-yxsrvorpzlor
{environment,nix-tools}: correct default `$PATH` ordering to match macOS
2025-01-18 01:11:06 +00:00
Emily
09414c7e2d
Merge pull request #1272 from emilazy/push-uooytqlwsquo
defaults-write: fix activation script conditionalization
2025-01-17 03:41:37 +00:00
Emily
8abb2e7244 nix: add hashes for Determinate Systems installer v0.33.0 and v0.34.0 2025-01-17 03:34:11 +00:00
Emily
2fe899db70 nix: check /etc/nix/nix.custom.conf hash 2025-01-17 03:34:11 +00:00
Michael Hoang
ca1f666b6d
Merge pull request #1262 from belak-forks/additional-tiling-options
Add support for additional window tiling options
2025-01-17 14:28:18 +11:00
Michael Hoang
c738b81ff5
Merge pull request #1265 from emilazy/push-turlyykvtunt
checks: check for macOS ≥ 11.3
2025-01-17 14:03:04 +11:00
Michael Hoang
97c05365cf
Merge pull request #1273 from emilazy/push-nlqypwmmvons
doc/manual: use `--replace-fail`
2025-01-17 13:52:55 +11:00
Kaleb Elwert
4075a3c23a Add support for additional window tiling options
This adds support for the following defaults:

- com.apple.WindowManager.EnableTilingByEdgeDrag
- com.apple.WindowManager.EnableTopTilingByEdgeDrag
- com.apple.WindowManager.EnableTilingOptionAccelerator
2025-01-15 22:53:21 -08:00
Emily
f959b8878b defaults-write: fix activation script conditionalization
These are lists, not attribute sets, so the condition was always
succeeding. As far as I can tell this bug has been present since the
function was added.
2025-01-16 00:13:57 +00:00
Emily
ff1d6384df {environment,nix-tools}: correct default $PATH ordering to match macOS 2025-01-15 23:26:14 +00:00
Emily
47174f3868 doc/manual: use --replace-fail 2025-01-15 23:19:28 +00:00
Emily
fe2fc038fd defaults/universalaccess: remove docs for macOS < 11 2025-01-14 15:56:20 +00:00
Emily
c5b7b604ca darwin-rebuild: remove code for macOS < 11 2025-01-14 15:56:20 +00:00
Emily
8f4f3d8d2d darwin-uninstaller: remove code for macOS < 11 2025-01-14 15:56:20 +00:00
Emily
1c21c9410e system: remove unnecessary sudo 2025-01-14 15:56:20 +00:00
Emily
b721000dc6 system: add missing newline 2025-01-14 15:56:20 +00:00