parts/pkgs: init custom packages

This commit is contained in:
Charlie Root 2024-09-09 21:31:49 +02:00
commit 6e146bc0c4
2 changed files with 50 additions and 0 deletions

28
parts/pkgs/default.nix Normal file
View file

@ -0,0 +1,28 @@
{inputs, ...}: {
# NOTE: We use flake-parts' easyOverlay module to extend our default packages with some extra packages I want to have.
#
imports = [inputs.flake-parts.flakeModules.easyOverlay];
perSystem = {
config,
lib,
pkgs,
...
}: {
# Attributes to add to overlays.default.
# The overlays.default overlay will re-evaluate perSystem with the “prev” (or “super”) overlay argument value
# as the pkgs module argument. The easyOverlay module also adds the final module argument, for the result of applying the overlay.
# When not in an overlay, final defaults to pkgs plus the generated overlay.
# This requires Nixpkgs to be re-evaluated, which is more expensive than setting
# pkgs to a Nixpkgs that already includes the necessary overlays that are required
# for the flake itself.
overlayAttrs = config.extraPackages;
# https://noogle.dev/f/lib/filesystem/packagesFromDirectoryRecursive
extraPackages = lib.packagesFromDirectoryRecursive {
inherit (pkgs) callPackage;
directory = ./extraPackages;
};
};
}