From 8938d311a5b4b1b6b14d9945ebf647b12822b70d Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 16 Jul 2024 02:17:23 +0200 Subject: [PATCH] packages: implement shadows --- packages/part.nix | 1 + packages/shadows.nix | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 packages/shadows.nix diff --git a/packages/part.nix b/packages/part.nix index 7823eae..c57ef79 100644 --- a/packages/part.nix +++ b/packages/part.nix @@ -9,6 +9,7 @@ in { ./projects.nix ./patched-inputs.nix ./catalog + ./shadows.nix ]; perSystem = { pkgs, self', system, ... }: let patched-derivations = import ./patched-derivations.nix (pkgs // { flakePackages = self'.packages; }); diff --git a/packages/shadows.nix b/packages/shadows.nix new file mode 100644 index 0000000..5ae7ec7 --- /dev/null +++ b/packages/shadows.nix @@ -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 + ; + }; + }; + }; +}