packages: implement shadows

This commit is contained in:
Max Headroom 2024-07-16 02:17:23 +02:00
parent 5dd4589459
commit 8938d311a5
2 changed files with 20 additions and 0 deletions

View file

@ -9,6 +9,7 @@ in {
./projects.nix ./projects.nix
./patched-inputs.nix ./patched-inputs.nix
./catalog ./catalog
./shadows.nix
]; ];
perSystem = { pkgs, self', system, ... }: let perSystem = { pkgs, self', system, ... }: let
patched-derivations = import ./patched-derivations.nix (pkgs // { flakePackages = self'.packages; }); patched-derivations = import ./patched-derivations.nix (pkgs // { flakePackages = self'.packages; });

19
packages/shadows.nix Normal file
View file

@ -0,0 +1,19 @@
{ lib, ... }:
{
perSystem = { inputs', self', ... }: {
# much like overlays, shadows can *shadow* packages in nixpkgs
# unlike overlays, shadows don't cause a nixpkgs re-evaluation
# this is a hack for dealing with poorly written NixOS modules
# that don't provide a `package` option to perform overrides
options.shadows = lib.mkOption {
type = with lib.types; lazyAttrsOf package;
default = {
inherit (self'.packages)
kanidm
;
};
};
};
}