1
1
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-08-16 08:00:34 +03:00
nix-darwin/default.nix
Drew Hess 9f7e95887f
Pass system to darwinSystem rather than eval-config.
This allows us to specify what kind of darwinSystem we want to build,
rather than determining it at evaluation time.
2021-09-08 13:05:18 +01:00

33 lines
899 B
Nix

{ nixpkgs ? <nixpkgs>
, configuration ? <darwin-config>
, lib ? pkgs.lib
, pkgs ? import nixpkgs { inherit system; }
, system ? builtins.currentSystem
}:
let
evalConfig = import ./eval-config.nix { inherit lib; };
eval = evalConfig {
inherit system;
modules = [ configuration ];
inputs = { inherit nixpkgs; };
};
# The source code of this repo needed by the [un]installers.
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.
name = "nix-darwin";
src = ./.;
}
);
in
eval // {
installer = pkgs.callPackage ./pkgs/darwin-installer { inherit nix-darwin; };
uninstaller = pkgs.callPackage ./pkgs/darwin-uninstaller { inherit nix-darwin; };
}