diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-24 14:59:29 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-24 14:59:29 +0200 |
commit | 0cc353f49f9c5d0e0bd203a6854b488a58daaa96 (patch) | |
tree | 48d4a821a842f94e3614f7c310423d9d2c98cc21 /pkgs/default.nix | |
parent | refactor(modules/unison): Migrate to `by-name` and parameterize (diff) | |
download | nixos-config-0cc353f49f9c5d0e0bd203a6854b488a58daaa96.tar.gz nixos-config-0cc353f49f9c5d0e0bd203a6854b488a58daaa96.zip |
refactor({modules,pkgs}/by-name-overlay): De-duplicate in a `nixLib`
Diffstat (limited to 'pkgs/default.nix')
-rw-r--r-- | pkgs/default.nix | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix index 66803694..39d225a9 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,13 +1,22 @@ { - pkgs, - sysLib, + pkgs ? (builtins.getFlake "nixpkgs").legacyPackages."x86_64-linux", + sysLib ? builtins.trace "Moking `sysLib`" {}, + nixLib ? import ../lib {}, }: let - # TODO: Filter the sources of every package in the shards <2024-05-25> - files = import ./by-name-overlay.nix { - inherit pkgs sysLib; - inherit (pkgs) lib; - baseDirectory = - ./by-name; + inherit (pkgs) lib; + + # FIXME: Make this override check actually work. + # I think that some parts of the lazy eval are causing that to not actually evaluate the + # error message. <2024-10-23> + maybeMergeMessage = "While merging the pkgs in ./pkgs/by-name to the nixpkgs set."; + mMM = maybeMergeMessage; + callPackage = lib.callPackageWith (nixLib.maybeMerge (nixLib.maybeMerge pkgs myPkgs mMM) {inherit sysLib;} mMM); + + myPkgs = nixLib.mkByName { + baseDirectory = ./by-name; + fileName = "package.nix"; + finalizeFunction = name: value: callPackage value {}; }; in - files + # TODO: Filter the sources of every package in the shards <2024-05-25> + myPkgs |