1
1
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-09-19 16:47:29 +03:00
nix-darwin/default.nix

38 lines
1.0 KiB
Nix
Raw Normal View History

{ nixpkgs ? <nixpkgs>, configuration ? <darwin-config>, system ? builtins.currentSystem
, pkgs ? import nixpkgs { inherit system; }
}:
let
baseModules = import ./modules/module-list.nix;
modules = [ configuration packages ] ++ baseModules;
packages = { config, lib, pkgs, ... }: {
_file = ./default.nix;
config = {
2018-01-07 01:20:43 +03:00
_module.args.pkgs = import nixpkgs config.nixpkgs;
nixpkgs.system = system;
};
};
eval = pkgs.lib.evalModules {
inherit modules;
args = { inherit baseModules modules; };
2017-10-20 23:19:26 +03:00
specialArgs = { modulesPath = ./modules; };
check = true;
};
# 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;
in
{
inherit (_module.args) pkgs;
2016-12-15 22:29:51 +03:00
inherit (eval) options config;
system = eval.config.system.build.toplevel;
2018-01-13 17:57:10 +03:00
installer = pkgs.callPackage ./pkgs/darwin-installer {};
2018-01-15 03:12:26 +03:00
uninstaller = pkgs.callPackage ./pkgs/darwin-uninstaller {};
}