diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2020-10-25 14:49:15 +0100 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2020-10-25 14:49:15 +0100 |
| commit | 5dfd0c44857c32f600ea7b4e86db7377bb9d997f (patch) | |
| tree | bb7cc033dae8834147fb735276a72d955f8cb35a /default.nix | |
| parent | 0dba44e04c33a69ec4c46e43de0ed024c1f7b75e (diff) | |
reuse evalConfig in default.nix
Diffstat (limited to 'default.nix')
| -rw-r--r-- | default.nix | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/default.nix b/default.nix index 79085aa..a475b47 100644 --- a/default.nix +++ b/default.nix @@ -1,33 +1,21 @@ -{ nixpkgs ? <nixpkgs>, configuration ? <darwin-config>, system ? builtins.currentSystem +{ nixpkgs ? <nixpkgs> +, configuration ? <darwin-config> +, lib ? pkgs.lib , pkgs ? import nixpkgs { inherit system; } +, system ? builtins.currentSystem }: let - baseModules = import ./modules/module-list.nix; - modules = [ configuration packages ] ++ baseModules; + evalConfig = import ./eval-config.nix { inherit lib system; }; - packages = { config, lib, pkgs, ... }: { - _file = ./default.nix; - config = { - _module.args.pkgs = import nixpkgs config.nixpkgs; - nixpkgs.system = system; - }; + eval = evalConfig { + modules = [ configuration ]; + inputs = { inherit nixpkgs; }; }; - eval = pkgs.lib.evalModules { - inherit modules; - args = { inherit baseModules modules; }; - 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; - # The source code of this repo needed by the [un]installers. - nix-darwin = pkgs.lib.cleanSource ( - pkgs.lib.cleanSourceWith { + nix-darwin = lib.cleanSource ( + 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. @@ -37,12 +25,7 @@ let ); in -{ - inherit (_module.args) pkgs; - inherit (eval) options config; - - system = eval.config.system.build.toplevel; - +eval // { installer = pkgs.callPackage ./pkgs/darwin-installer { inherit nix-darwin; }; uninstaller = pkgs.callPackage ./pkgs/darwin-uninstaller { inherit nix-darwin; }; } |
