diff options
| author | Emily <vcs@emily.moe> | 2023-07-07 09:02:38 +0100 |
|---|---|---|
| committer | Emily <vcs@emily.moe> | 2023-07-08 22:39:19 +0100 |
| commit | e25eeff158ceb415079e38f6e78a470c5664fa2f (patch) | |
| tree | 82bcee2a2c7d5d3bd3b7d4e074f937329c0205fd /eval-config.nix | |
| parent | 2d20e861112955cd2d102d0a0abf36d265001a5d (diff) | |
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.)
Diffstat (limited to 'eval-config.nix')
| -rw-r--r-- | eval-config.nix | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/eval-config.nix b/eval-config.nix index 4b71303..2beb121 100644 --- a/eval-config.nix +++ b/eval-config.nix @@ -26,15 +26,9 @@ let pkgsModule = { config, inputs, ... }: { _file = ./eval-config.nix; config = { - assertions = [ { - # Ensure that nixpkgs.* options are not set when pkgs is set - assertion = pkgs == null || (config.nixpkgs.config == { } && config.nixpkgs.overlays == [ ]); - message = '' - `nixpkgs` options are disabled when `pkgs` is supplied through `darwinSystem`. - ''; - } ]; - - _module.args.pkgs = if pkgs != null then pkgs else import inputs.nixpkgs config.nixpkgs; + _module.args.pkgs = lib.mkIf (pkgs != null) (lib.mkForce pkgs); + + nixpkgs.source = lib.mkDefault inputs.nixpkgs; # This permits the configuration to override the passed-in # system. |
