summaryrefslogtreecommitdiff
path: root/modules/overlays
diff options
context:
space:
mode:
Diffstat (limited to 'modules/overlays')
-rw-r--r--modules/overlays/default.nix19
-rw-r--r--modules/overlays/emacs.nix36
-rw-r--r--modules/overlays/g45_h264.nix36
3 files changed, 38 insertions, 53 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");
}
diff --git a/modules/overlays/emacs.nix b/modules/overlays/emacs.nix
index 7ed9658..05bb663 100644
--- a/modules/overlays/emacs.nix
+++ b/modules/overlays/emacs.nix
@@ -1,25 +1,13 @@
-{ lib, config, ... }:
-
-{
- options = {
- this.overlays.emacs.enable = lib.mkEnableOption "custom-built Emacs overlay";
- };
-
- config = lib.mkIf config.this.overlays.emacs.enable {
- nixpkgs.overlays = [
- (final: prev: {
- emacs = (prev.emacs.override {
- withNativeCompilation = false;
- withXwidgets = false;
- withX = true;
- withGTK3 = false;
- withAthena = false;
- }).overrideAttrs (attrs: with builtins; with attrs; {
- configureFlags = filter (f: !elem f
- ["--with-x-toolkit=lucid" "--with-toolkit-scroll-bars"])
- configureFlags ++ ["--with-x-toolkit=no" "--without-toolkit-scroll-bars"];
- });
- })
- ];
- };
+final: prev: {
+ emacs = (prev.emacs.override {
+ withNativeCompilation = false;
+ withXwidgets = false;
+ withX = true;
+ withGTK3 = false;
+ withAthena = false;
+ }).overrideAttrs (attrs: with builtins; with attrs; {
+ configureFlags = filter (f: !elem f
+ ["--with-x-toolkit=lucid" "--with-toolkit-scroll-bars"])
+ configureFlags ++ ["--with-x-toolkit=no" "--without-toolkit-scroll-bars"];
+ });
}
diff --git a/modules/overlays/g45_h264.nix b/modules/overlays/g45_h264.nix
index 9df5ae1..b8e4513 100644
--- a/modules/overlays/g45_h264.nix
+++ b/modules/overlays/g45_h264.nix
@@ -1,25 +1,13 @@
-{ lib, config, pkgs, ... }:
-
-{
- options = {
- this.overlays.g45_h264.enable = lib.mkEnableOption "intel-vaapi-driver with h264 support on gm45";
- };
-
- config = lib.mkIf config.this.overlays.g45_h264.enable {
- nixpkgs.overlays = [
- (final: prev: {
- intel-vaapi-driver =
- prev.intel-vaapi-driver.overrideAttrs
- (attrs: attrs // {
- src = pkgs.fetchzip {
- url = "https://bitbucket.org/alium/g45-h264/downloads/intel-driver-g45-h264-2.4.1.tar.gz";
- sha256 = "h23mQV7WdtQjhkpUlnyHcwVTz+T3BZSuqfuKru4LClo=";
- name = "intel-driver-g45-h264-2.4.1-source";
- };
- version = "2.4.1-g45-h264";
- preBuild = "patchShebangs src";
- });
- })
- ];
- };
+final: prev: {
+ intel-vaapi-driver =
+ prev.intel-vaapi-driver.overrideAttrs
+ (attrs: attrs // {
+ src = final.fetchzip {
+ url = "https://bitbucket.org/alium/g45-h264/downloads/intel-driver-g45-h264-2.4.1.tar.gz";
+ sha256 = "h23mQV7WdtQjhkpUlnyHcwVTz+T3BZSuqfuKru4LClo=";
+ name = "intel-driver-g45-h264-2.4.1-source";
+ };
+ version = "2.4.1-g45-h264";
+ preBuild = "patchShebangs src";
+ });
}