mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-28 02:37:09 +00:00
nixpkgs: add support for overlays
This commit is contained in:
parent
52cf461055
commit
9780fb0f0b
2 changed files with 41 additions and 5 deletions
|
@ -6,10 +6,8 @@ let
|
|||
|
||||
packages = { config, lib, pkgs, ... }: {
|
||||
config = {
|
||||
_module.args.pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
inherit (config.nixpkgs) config;
|
||||
};
|
||||
_module.args.pkgs = import nixpkgs config.nixpkgs;
|
||||
nixpkgs.system = system;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -34,11 +34,16 @@ let
|
|||
merge = args: fold (def: mergeConfig def.value) {};
|
||||
};
|
||||
|
||||
overlayType = mkOptionType {
|
||||
name = "nixpkgs-overlay";
|
||||
description = "nixpkgs overlay";
|
||||
check = builtins.isFunction;
|
||||
merge = lib.mergeOneOption;
|
||||
};
|
||||
in
|
||||
|
||||
{
|
||||
options = {
|
||||
|
||||
nixpkgs.config = mkOption {
|
||||
default = {};
|
||||
example = literalExample
|
||||
|
@ -63,6 +68,39 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
nixpkgs.overlays = mkOption {
|
||||
type = types.listOf overlayType;
|
||||
default = [];
|
||||
example = literalExample ''
|
||||
[ (self: super: {
|
||||
openssh = super.openssh.override {
|
||||
hpnSupport = true;
|
||||
withKerberos = true;
|
||||
kerberos = self.libkrb5;
|
||||
};
|
||||
};
|
||||
) ]
|
||||
'';
|
||||
description = ''
|
||||
List of overlays to use with the Nix Packages collection.
|
||||
(For details, see the Nixpkgs documentation.) It allows
|
||||
you to override packages globally. This is a function that
|
||||
takes as an argument the <emphasis>original</emphasis> Nixpkgs.
|
||||
The first argument should be used for finding dependencies, and
|
||||
the second should be used for overriding recipes.
|
||||
'';
|
||||
};
|
||||
|
||||
nixpkgs.system = mkOption {
|
||||
type = types.str;
|
||||
example = "x86_64-darwin";
|
||||
description = ''
|
||||
Specifies the Nix platform type for which NixOS should be built.
|
||||
If unset, it defaults to the platform type of your host system.
|
||||
Specifying this option is useful when doing distributed
|
||||
multi-platform deployment, or when building virtual machines.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
Loading…
Add table
Reference in a new issue