summaryrefslogtreecommitdiff
path: root/eval-config.nix
AgeCommit message (Collapse)Author
2024-06-13Reapply "eval-config: set `class`"Emily
All supported Nixpkgs versions now support this. This reverts commit a5b09580e2d0bbc52b338afe4f1f1d46178e6bbf.
2023-10-03expose _module attr in realised sysconfigppenguin
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2023-07-24Revert "eval-config: set `class`"Emily
2023-07-21eval-config: set `class`Emily
See [the Nixpkgs manual]. This allows modules to declare themselves as being only for NixOS or nix-darwin, reducing compatibility risks. Unmarked modules will continue to behave as before. Technically a breaking change, but any configuration importing a module explicitly marked as NixOS-specific was probably broken already. [the Nixpkgs manual]: https://nixos.org/manual/nixpkgs/unstable/#module-system-lib-evalModules-param-class
2023-07-09eval-config: rationalize handling of NixpkgsEmily
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-08nixpkgs: rebase module on latest NixOSEmily
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-06-24eval-config: remove compatibility shimsEmily
20.03 and 22.03 are both deprecated.
2023-06-24eval-config: remove `lib.mdDoc`Emily
The temporarily pinned nixpkgs version already has this version, and where we're going, we don't need backports. This reverts commit 737cfdec9ce54eed56b4f9c281bbd892ebf5dc6b.
2023-06-21eval-config.nix: readd `lib.mdDoc` temporarilyEmily
Fixes: #701
2022-09-19eval-config: make lib overridablezimbatm
This enables using flake lib.darwinSystem function with your custom lib.
2022-02-04eval-config: Support passing in `pkgs`Michael Hoang
This is useful for flake users as they will usually already have an instantiated Nixpkgs e.g. let pkgs = import nixpkgs { config.allowUnfree = true; overlays = [ ... ]; } in darwin.lib.darwinSystem { inherit pkgs; } This change makes `nix-darwin` match the behaviour of NixOS and `home-manager`.
2022-01-04eval-config: Add check parameter for compatibility with nixpkgs.John Soo
2022-01-02eval-config.nix: Fix args warningRobert Hensing
2021-10-23add forward compatibility for literalExample deprecationDaiderd Jordan
Fixes #367
2021-09-08Pass system to darwinSystem rather than eval-config.Drew Hess
This allows us to specify what kind of darwinSystem we want to build, rather than determining it at evaluation time.
2020-10-21add flake and split evalConfigDaiderd Jordan