Add an overlays folder
- Enable overlays
- Add the overlays to home-manager
- Add support for packages
diff --git a/modules/home-manager.nix b/modules/home-manager.nix
index 1c1466e..44f82d8 100644
--- a/modules/home-manager.nix
+++ b/modules/home-manager.nix
@@ -1,4 +1,11 @@
-{home-manager, ...}: {
+{
+ home-manager,
+ lib,
+ ...
+}: {
imports = [home-manager.nixosModules.home-manager];
- config.home-manager.useGlobalPkgs = true;
+ config = {
+ home-manager.useGlobalPkgs = true;
+ nixpkgs.overlays = import ../overlays lib;
+ };
}
diff --git a/overlays/default.nix b/overlays/default.nix
new file mode 100644
index 0000000..3cebd99
--- /dev/null
+++ b/overlays/default.nix
@@ -0,0 +1,10 @@
+lib: let
+ utils = import ../utils lib;
+in
+ lib.pipe ./. [
+ utils.nixFilesInWithName
+ (builtins.filter ({name, ...}: name != "default.nix"))
+ (lib.traceValFn (overlays: "Applying overlays ${builtins.toJSON (map (overlay: overlay.name) overlays)}"))
+ (builtins.map ({path, ...}: lib.traceVal path))
+ (map (path: import path lib))
+ ]
diff --git a/overlays/packages.nix b/overlays/packages.nix
new file mode 100644
index 0000000..909c5ff
--- /dev/null
+++ b/overlays/packages.nix
@@ -0,0 +1,14 @@
+lib: final: prev: let
+ utils = import ../utils lib;
+in
+ lib.pipe ../packages [
+ utils.nixFilesInWithName
+ (map ({
+ name,
+ path,
+ }: {
+ name = builtins.substring 0 ((builtins.stringLength name) - 4) name;
+ value = final.callPackage path {};
+ }))
+ builtins.listToAttrs
+ ]