1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-14 11:47:31 +00:00

Add overlay

This commit is contained in:
Robert Hensing 2021-11-22 22:44:28 +01:00
parent 0cf2ff3e94
commit 77771f1d6d
2 changed files with 33 additions and 0 deletions

View file

@ -7,6 +7,7 @@
./modules/flake.nix
./modules/legacyPackages.nix
./modules/nixosModules.nix
./modules/overlay.nix
./modules/packages.nix
./modules/perSystem.nix
];

32
modules/overlay.nix Normal file
View file

@ -0,0 +1,32 @@
{ config, lib, flake-modules-core-lib, ... }:
let
inherit (lib)
mkOption
types
;
inherit (flake-modules-core-lib)
mkSubmoduleOptions
;
in
{
options = {
flake = mkSubmoduleOptions {
overlay = mkOption {
# uniq should be ordered: https://github.com/NixOS/nixpkgs/issues/147052
# also update description when done
type = types.uniq (types.functionTo (types.functionTo (types.lazyAttrsOf types.unspecified)));
# This eta expansion exists for the sole purpose of making nix flake check happy.
apply = f: final: prev: f final prev;
default = _: _: { };
defaultText = lib.literalExpression or lib.literalExample ''final: prev: {}'';
description = ''
An overlay.
Note that this option's type is not mergeable. While overlays can be
composed, the order of composition is significant, but the module
system does not guarantee deterministic definition ordering.
'';
};
};
};
}