1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00
nix-darwin/flake.nix
Michael Hoang 5528b36698 eval-config: Support passing in pkgs
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-02-04 21:32:40 +11:00

33 lines
1.1 KiB
Nix

{
# WARNING this is very much still experimental.
description = "A collection of darwin modules";
outputs = { self, nixpkgs }: {
lib = {
# TODO handle multiple architectures.
evalConfig = import ./eval-config.nix { inherit (nixpkgs) lib; };
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;
darwinModules.hydra = ./modules/examples/hydra.nix;
darwinModules.lnl = ./modules/examples/lnl.nix;
darwinModules.ofborg = ./modules/examples/ofborg.nix;
darwinModules.simple = ./modules/examples/simple.nix;
checks.x86_64-darwin.simple = (self.lib.darwinSystem {
system = "x86_64-darwin";
modules = [ self.darwinModules.simple ];
}).system;
};
}