1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00
nix-darwin/default.nix

38 lines
1 KiB
Nix
Raw Normal View History

2020-10-25 13:49:15 +00:00
{ nixpkgs ? <nixpkgs>
, configuration ? <darwin-config>
, lib ? pkgs.lib
, pkgs ? import nixpkgs { inherit system; }
2020-10-25 13:49:15 +00:00
, system ? builtins.currentSystem
}:
let
evalConfig = import ./eval-config.nix { inherit lib; };
2020-10-25 13:49:15 +00:00
eval = evalConfig {
inherit system;
modules = [ configuration nixpkgsRevisionModule ];
2020-10-25 13:49:15 +00:00
inputs = { inherit nixpkgs; };
};
nixpkgsRevisionModule =
if nixpkgs?rev && lib.isString nixpkgs.rev
then { system.nixpkgsRevision = nixpkgs.rev; }
else { };
# The source code of this repo needed by the [un]installers.
2020-10-25 13:49:15 +00:00
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
2020-10-25 13:49:15 +00:00
eval // {
installer = pkgs.callPackage ./pkgs/darwin-installer { inherit nix-darwin; };
uninstaller = pkgs.callPackage ./pkgs/darwin-uninstaller { inherit nix-darwin; };
}