about summary refs log tree commit diff
path: root/users/tazjin/emacs/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-02-08T08·57+0300
committerclbot <clbot@tvl.fyi>2022-02-08T18·06+0000
commit333c12d72d84beb0b90564930f80bd6192088ef9 (patch)
treea72347052ae7c1d43d8177e852575edfc6ce0c03 /users/tazjin/emacs/default.nix
parentaab994e0dc02c90fec928bca27d373f0cbea0d40 (diff)
fix(tazjin/emacs): Correctly pass through additional attributes r/3798
We really need target list diffing, would have caught this earlier.

Change-Id: Ifc064400b3115c6e2242d0b503cde4216b2ee787
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5257
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/emacs/default.nix')
-rw-r--r--users/tazjin/emacs/default.nix59
1 files changed, 32 insertions, 27 deletions
diff --git a/users/tazjin/emacs/default.nix b/users/tazjin/emacs/default.nix
index f7fc77be70f5..ae1879ba850f 100644
--- a/users/tazjin/emacs/default.nix
+++ b/users/tazjin/emacs/default.nix
@@ -128,7 +128,7 @@ pkgs.makeOverridable
       '';
   in
   lib.fix
-    (self: l: f: pkgs.writeShellScriptBin "tazjins-emacs" ''
+    (self: l: f: (pkgs.writeShellScriptBin "tazjins-emacs" ''
       export PATH="${emacsBinPath}:$PATH"
       exec ${tazjinsEmacs f}/bin/emacs \
         --debug-init \
@@ -137,35 +137,40 @@ pkgs.makeOverridable
         --no-init-file \
         --directory ${./config} ${if l != null then "--directory ${l}" else ""} \
         --eval "(require 'init)" $@
-    '' // {
-      # Call overrideEmacs with a function (pkgs -> pkgs) to modify the
-      # packages that should be included in this Emacs distribution.
-      overrideEmacs = f': self l f';
+    '').overrideAttrs
+      (_: {
+        passthru = {
+          # Call overrideEmacs with a function (pkgs -> pkgs) to modify the
+          # packages that should be included in this Emacs distribution.
+          overrideEmacs = f': self l f';
 
-      # Call withLocalConfig with the path to a *folder* containing a
-      # `local.el` which provides local system configuration.
-      withLocalConfig = confDir: self confDir f;
+          # Call withLocalConfig with the path to a *folder* containing a
+          # `local.el` which provides local system configuration.
+          withLocalConfig = confDir: self confDir f;
 
-      # Build a derivation that uses the specified local Emacs (i.e.
-      # built outside of Nix) instead
-      withLocalEmacs = emacsBin: pkgs.writeShellScriptBin "tazjins-emacs" ''
-        export PATH="${emacsBinPath}:$PATH"
-        export EMACSLOADPATH="${(tazjinsEmacs f).deps}/share/emacs/site-lisp:"
-        exec ${emacsBin} \
-          --debug-init \
-          --no-site-file \
-          --no-site-lisp \
-          --no-init-file \
-          --directory ${./config} \
-          ${if l != null then "--directory ${l}" else ""} \
-          --eval "(require 'init)" $@
-      '';
+          # Build a derivation that uses the specified local Emacs (i.e.
+          # built outside of Nix) instead
+          withLocalEmacs = emacsBin: pkgs.writeShellScriptBin "tazjins-emacs" ''
+            export PATH="${emacsBinPath}:$PATH"
+            export EMACSLOADPATH="${(tazjinsEmacs f).deps}/share/emacs/site-lisp:"
+            exec ${emacsBin} \
+              --debug-init \
+              --no-site-file \
+              --no-site-lisp \
+              --no-init-file \
+              --directory ${./config} \
+              ${if l != null then "--directory ${l}" else ""} \
+              --eval "(require 'init)" $@
+          '';
 
-      # Expose telega/tdlib version check as a target that is built in
-      # CI.
-      inherit tdlibCheck;
-      meta.ci.targets = [ "tdlibCheck" ];
-    })
+          # Expose telega/tdlib version check as a target that is built in
+          # CI.
+          #
+          # TODO(tazjin): uncomment when telega works again
+          inherit tdlibCheck;
+          meta.ci.targets = [ "tdlibCheck" ];
+        };
+      }))
     null
     identity
   )