summaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2024-07-22 03:35:41 -0400
committerseth <[email protected]>2024-07-22 03:35:41 -0400
commit3e9ee17994ef6956aa4396a02ef8db4d60a978f9 (patch)
tree7e75ea9083647e9094e2d85d9f92bb4b39671e99 /default.nix
parentcec5413fcc0ca6b2049efe5a44f3b3fbe6f5f0a1 (diff)
use scope to call packages
now i don't need ugly attribute overrides
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix22
1 files changed, 10 insertions, 12 deletions
diff --git a/default.nix b/default.nix
index 17aa27c..94e4cf4 100644
--- a/default.nix
+++ b/default.nix
@@ -17,20 +17,18 @@ in
system ? builtins.currentSystem,
}:
let
- packages =
+ packageDirectory = ./pkgs;
+
+ scope = lib.makeScope pkgs.newScope (
+ final:
lib.packagesFromDirectoryRecursive {
- inherit (pkgs) callPackage;
- directory = ./pkgs;
+ inherit (final) callPackage;
+ directory = packageDirectory;
}
- // {
- flat-manager = pkgs.callPackage ./pkgs/flat-manager/package.nix {
- inherit (packages) flat-manager;
- };
- flat-manager-client = pkgs.callPackage ./pkgs/flat-manager-client/package.nix {
- inherit (packages) flat-manager;
- };
+ );
- papa = pkgs.callPackage ./pkgs/papa/package.nix { inherit (packages) papa; };
- };
+ # Filter extraneous attributes from the scope, based on the files in our package directory
+ packageFileNames = builtins.attrNames (builtins.readDir packageDirectory);
+ packages = lib.getAttrs packageFileNames scope;
in
packages