summaryrefslogtreecommitdiff
path: root/modules/overlays/default.nix
diff options
context:
space:
mode:
authorSimon Parri <simonparri@ganzeria.com>2025-05-17 12:40:06 -0500
committerSimon Parri <simonparri@ganzeria.com>2025-05-17 12:40:06 -0500
commit97e80a86dc3734e18dc23a23bdbd866ffa7d07b4 (patch)
tree1903d5f444b157ae95e1bf71189fa94a58c32d1f /modules/overlays/default.nix
parent4d223df38fad817dfde29e292de5d88658137675 (diff)
downloadnixos-config-97e80a86dc3734e18dc23a23bdbd866ffa7d07b4.tar.gz
nixos-config-97e80a86dc3734e18dc23a23bdbd866ffa7d07b4.zip
modules/overlays: Make overlay .nix files be plain overlay functions
Also restructure modules/overlays/default.nix to account for this; move all overlay options into default.nix and load the overlay functions conditionally from there.
Diffstat (limited to 'modules/overlays/default.nix')
-rw-r--r--modules/overlays/default.nix19
1 files changed, 14 insertions, 5 deletions
diff --git a/modules/overlays/default.nix b/modules/overlays/default.nix
index 60253ca..745673a 100644
--- a/modules/overlays/default.nix
+++ b/modules/overlays/default.nix
@@ -1,8 +1,17 @@
-{ ... }:
+{ lib, config, ... }:
+let cfg = config.this.overlays;
+ overlay = ov:
+ lib.optional cfg."${ov}".enable
+ (import ./${ov}.nix);
+in
{
- imports = [
- ./emacs.nix
- ./g45_h264.nix
- ];
+ options = {
+ this.overlays.emacs.enable = lib.mkEnableOption "custom-built Emacs overlay";
+ this.overlays.g45_h264.enable = lib.mkEnableOption "intel-vaapi-driver with h264 support on gm45";
+ };
+
+ config.nixpkgs.overlays =
+ (overlay "emacs") ++
+ (overlay "g45_h264");
}