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

1386 commits

Author SHA1 Message Date
Michael Hoang
4511c29a72 flake: use nix-darwin instead of darwin 2023-07-12 10:36:14 +10:00
Emily
eb22022ba8
Merge pull request #687 from Enzime/flaky
Install nix-darwin on flake-based systems
2023-07-11 23:59:03 +01:00
Michael Hoang
63af129cb5 etc: use .before-nix-darwin instead of .orig 2023-07-12 08:35:36 +10:00
Michael Hoang
ac9a366aed uninstaller: remove /Applications/Nix Apps 2023-07-11 18:59:05 +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
4b90ea84e4 doc: store a copy of known files 2023-07-11 18:59:05 +10:00
Michael Hoang
7881727017 installer: match flaky installation logic 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
Michael Hoang
f70f90c422 flake: add packages.darwin-{option,rebuild} 2023-07-11 18:59:05 +10:00
Michael Hoang
aeaafcc88a flake: add packages.darwin-uninstaller 2023-07-11 18:59:05 +10:00
Michael Hoang
83620edf49
Merge pull request #577 from 2xsaiko/outgoing/systembuildercommands
Add system.systemBuilderCommands and systemBuilderArgs
2023-07-11 00:30:59 +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
Michael Hoang
97d4a91029
Merge pull request #545 from amarshall/remove-nix-readonlystore
nix: Remove readOnlyStore option as it has no effect
2023-07-10 22:46:31 +10:00
Andrew Marshall
591446ca94 nix: Remove readOnlyStore option as it has no effect
This being under `nix` in upstream is misleading as it is only used in
the NixOS boot stage, not as configuration for the Nix daemon.
2023-07-10 08:30:38 -04:00
Andrew Marshall
4a7da05c1e Fix spelling 2023-07-10 08:30:15 -04:00
Emily
90ae979e35
Merge pull request #488 from cuichenli/fix-zsh-issue
fix zsh eating output without new line ending
2023-07-10 08:12:58 +01:00
Cuichen Li
8364529fc4 fix zsh eating output without new line ending 2023-07-10 15:00:02 +08:00
Daiderd Jordan
66a3047fa8
Merge pull request #723 from emilazy/rationalize-nixpkgs-handling
Rationalize handling of Nixpkgs
2023-07-09 12:34:19 +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
Daiderd Jordan
4e3fc18647
Merge pull request #724 from Enzime/fix/darwin-builder
linux-builder: fix evaluation errors
2023-07-09 08:02:16 +02:00
Michael Hoang
d9e825f121 linux-builder: fix evaluation errors
- `modules` cannot be a nested list
- `nix.settings.extra-trusted-users` might not be set
2023-07-09 13:55:22 +10:00
Domen Kožar
4272af4079
Merge pull request #684 from Enzime/add/linux-builder
nix/linux-builder: init
2023-07-09 00:00:48 +01:00
Emily
e25eeff158 nixpkgs: rebase module on latest NixOS
This is based on the current NixOS `nixpkgs` module, adjusted for the
nix-darwin context and without adding the options due for deprecation
in NixOS.

This gives us the ability to set the package set modularly through
`nixpkgs.pkgs` and builds up infrastructure for handling user-specified
Nixpkgs instantiations more robustly.

The cross-compilation options are currently not very useful due to
even Darwin->Darwin cross-compilation not being wholly functional
yet, but it looks feasible to build an `aarch64-darwin` system from
`x86_64-darwin` with some patching and it should be possible to make
cross-compilation more widely supported after the Darwin SDK situation
in Nixpkgs improves.

One casualty is the error for setting `nixpkgs.*` options when
overriding the package set. That could be ported over to this new
scheme, but it'd increase divergence with the NixOS module and reduce
cross-compatibility of configurations, so I lean towards adding it
upstream to NixOS if anything. (But if people want to keep it I can add
it back.)
2023-07-08 22:39:19 +01:00
Emily
2d20e86111 documentation: use feature test for docs generator
This should be less brittle than the version-based check, although
arguably this kind of `lib.version` mismatch should break as early
as possible...

Fixes: #718
2023-07-08 21:04:34 +01:00
Michael Hoang
d2b01ab455 nix/linux-builder: init 2023-07-08 14:05:37 +10:00
Domen Kožar
b06bab83bd
Merge pull request #711 from Enzime/fix/magicdns
tailscale: improve MagicDNS setup
2023-07-02 15:17:20 +01:00
Domen Kožar
43587cdb72
Merge pull request #714 from lovesegfault/rebuild-refresh
feat(darwin-rebuild): support --refresh
2023-06-30 18:23:00 +01:00
Domen Kožar
48b07e266b
Merge pull request #717 from hercules-ci/fix-doc-revision
Fix doc revision eval error
2023-06-30 18:22:09 +01:00
Robert Hensing
89ec258c7c documentation: Link to nixpkgs master if rev is unknown
This fixes

    error: The option `system.nixpkgsRevision' is used but not defined.
2023-06-30 02:14:35 +02:00
Robert Hensing
d207fa6091 default.nix: Use nixpkgs.rev if it is set
This increases the odds of automatically setting system.nixpkgsRevision,
which makes the links in the manual nice.
2023-06-30 02:13:09 +02:00
Bernardo Meurer
9af7fe60b6
feat(darwin-rebuild): support --refresh
This flag allows forcing remote flakes (e.g. `github:foobar/nix-config`)
to be force-refreshed, which is required for quickly
iterating/activating a remote config.
2023-06-28 12:47:32 -04:00
Michael Hoang
d2b70c61bf tailscale: improve MagicDNS setup 2023-06-27 01:38:51 +10:00
Daiderd Jordan
25ae710ba3
also update README in gh-pages 2023-06-25 13:07:55 +02:00
Daiderd Jordan
cb37c35e33
fix darwin-option descriptions
Also drops the eval hacks in favour of jq.
2023-06-25 13:03:52 +02:00
Daiderd Jordan
53c6748f98
Merge pull request #675 from serokell/rvem/update-buildkite-module
buildkite-agent: fix launchd daemon environment
2023-06-25 10:52:13 +02:00
Daiderd Jordan
de8a019304
Merge pull request #710 from emilazy/fix-manual-ci
ci: update manual updater to 23.05
2023-06-25 10:12:53 +02:00
Emily
a62f16b94d readme: update links for redirect 2023-06-25 06:43:54 +01:00
Emily
df03a145b3 ci: update manual updater to 23.05
Fix https://github.com/LnL7/nix-darwin/issues/709.
2023-06-25 06:43:54 +01:00
Daiderd Jordan
ace0ef2a26
Merge pull request #707 from emilazy/options-markdown-migration
Migrate option documentation to Markdown
2023-06-24 23:42:39 +02:00
Emily
9d6702cf2b eval-config: remove compatibility shims
20.03 and 22.03 are both deprecated.
2023-06-24 10:48:55 +01:00
Emily
42d1643e7a {ci,readme}: update stable nixpkgs to 23.05
22.11 is deprecated and can no longer generate the manual.
2023-06-24 10:48:55 +01:00
Emily
69648c6cbb doc/manual: use nixos-render-docs
Now that all the DocBook documentation is gone, we can switch to the
new NixOS documentation generator. No meaningful change in HTML output,
except that I removed the rather pointless preface and changed the
title accordingly. Manual page output is greatly improved; it was
kind of broken before. The `sed` hack is pretty gross but I have
confirmed that nixpkgs will be happy to accept a PR to make things
a little more customizable.

This also drops the `manual` alias (deprecated in nixpkgs in 2018
and imported into nix-darwin), and `manualEpub` (because the NixOS
documentation generator doesn't support it and also nobody wants this
as an ebook).
2023-06-24 10:48:55 +01:00
Emily
d37abf456b flake.nix: remove the nixpkgs pin
The Markdown transition is over and our compatibility with
`nixpkgs-unstable` is restored.
2023-06-24 10:48:55 +01:00
Emily
2903ceabb5 doc/manual: remove optionsDocBook export 2023-06-24 10:48:55 +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
c2716817a8 {offlineimap,tailscale}: fix enable option docs
The argument to `mkEnableOption` is automatically wrapped in a full
sentence.
2023-06-24 10:48:55 +01:00