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

improve flakes missing system error message

This commit is contained in:
Daiderd Jordan 2021-09-15 20:22:23 +02:00
parent 738eff4f33
commit e1a3f7292f
No known key found for this signature in database
GPG key ID: D02435D05B810C96
2 changed files with 12 additions and 7 deletions

View file

@ -7,11 +7,16 @@
# TODO handle multiple architectures.
evalConfig = import ./eval-config.nix { inherit (nixpkgs) lib; };
darwinSystem = { modules, system, inputs ? { }, ... }@args: self.lib.evalConfig (args // {
inherit system;
inputs = { inherit nixpkgs; darwin = self; } // inputs;
modules = modules ++ [ self.darwinModules.flakeOverrides ];
});
darwinSystem =
{ modules, inputs ? { }
, system ? throw "darwin.lib.darwinSystem now requires 'system' to be passed explicitly"
, ...
}@args:
self.lib.evalConfig (args // {
inherit system;
inputs = { inherit nixpkgs; darwin = self; } // inputs;
modules = modules ++ [ self.darwinModules.flakeOverrides ];
});
};
darwinModules.flakeOverrides = ./modules/system/flake-overrides.nix;

View file

@ -18,11 +18,11 @@
in
{
# Build darwin flake using:
# $ darwin-rebuild build --flake ./modules/examples#darwinConfigurations.simple.system \
# $ darwin-rebuild build --flake ./modules/examples#simple \
# --override-input darwin .
darwinConfigurations."simple" = darwin.lib.darwinSystem {
system = "x86_64-darwin";
modules = [ configuration darwin.darwinModules.simple ];
system = "x86_64-darwin";
};
# Expose the package set, including overlays, for convenience.