2017-01-15 08:51:00 +00:00
|
|
|
{ nixpkgs ? <nixpkgs>, configuration ? <darwin-config>, system ? builtins.currentSystem
|
|
|
|
, pkgs ? import nixpkgs { inherit system; }
|
|
|
|
}:
|
2016-12-10 11:57:09 +00:00
|
|
|
|
|
|
|
let
|
2019-05-04 12:50:22 +00:00
|
|
|
baseModules = import ./modules/module-list.nix;
|
|
|
|
modules = [ configuration packages ] ++ baseModules;
|
2016-12-10 11:57:09 +00:00
|
|
|
|
2017-01-15 08:51:00 +00:00
|
|
|
packages = { config, lib, pkgs, ... }: {
|
2018-01-06 22:21:34 +00:00
|
|
|
_file = ./default.nix;
|
2017-01-15 08:51:00 +00:00
|
|
|
config = {
|
2018-01-06 22:20:43 +00:00
|
|
|
_module.args.pkgs = import nixpkgs config.nixpkgs;
|
|
|
|
nixpkgs.system = system;
|
2017-01-15 08:51:00 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-12-10 11:57:09 +00:00
|
|
|
eval = pkgs.lib.evalModules {
|
2019-05-04 12:50:22 +00:00
|
|
|
inherit modules;
|
|
|
|
args = { inherit baseModules modules; };
|
2017-10-20 20:19:26 +00:00
|
|
|
specialArgs = { modulesPath = ./modules; };
|
2016-12-10 11:57:09 +00:00
|
|
|
check = true;
|
|
|
|
};
|
2020-03-22 22:13:59 +00:00
|
|
|
|
|
|
|
# Was moved in nixpkgs #82751, so both need to be handled here until 20.03 is deprecated.
|
|
|
|
# https://github.com/NixOS/nixpkgs/commits/dcdd232939232d04c1132b4cc242dd3dac44be8c
|
|
|
|
_module = eval._module or eval.config._module;
|
2020-08-14 21:25:26 +00:00
|
|
|
|
|
|
|
# The source code of this repo needed by the [un]installers.
|
|
|
|
nix-darwin = pkgs.lib.cleanSource (
|
|
|
|
pkgs.lib.cleanSourceWith {
|
|
|
|
# We explicitly specify a name here otherwise `cleanSource` will use the
|
|
|
|
# basename of ./. which might be different for different clones of this
|
|
|
|
# repo leading to non-reproducible outputs.
|
|
|
|
name = "nix-darwin";
|
|
|
|
src = ./.;
|
|
|
|
}
|
|
|
|
);
|
2016-12-10 11:57:09 +00:00
|
|
|
in
|
2016-12-11 11:49:11 +00:00
|
|
|
|
|
|
|
{
|
2020-03-22 22:13:59 +00:00
|
|
|
inherit (_module.args) pkgs;
|
2016-12-15 19:29:51 +00:00
|
|
|
inherit (eval) options config;
|
2017-01-15 08:51:00 +00:00
|
|
|
|
|
|
|
system = eval.config.system.build.toplevel;
|
2018-01-13 14:57:10 +00:00
|
|
|
|
2020-08-14 21:25:26 +00:00
|
|
|
installer = pkgs.callPackage ./pkgs/darwin-installer { inherit nix-darwin; };
|
|
|
|
uninstaller = pkgs.callPackage ./pkgs/darwin-uninstaller { inherit nix-darwin; };
|
2016-12-11 11:49:11 +00:00
|
|
|
}
|