From d149c21b5ba9d7db114503677744d991188efe5b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 01:35:00 +0100 Subject: [PATCH] chore(deps): lock file maintenance (#414) * chore(deps): lock file maintenance * chore: replace deprecated if-let/when-let functions * fix: typo in racket-mode use-package definition * feat: use twist lib to byte compile init files --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Terje Larsen --- default.nix | 46 +++++++++++------------- dev/flake.lock | 75 ++++++++++++++++++---------------------- flake.lock | 48 ++++++++++++------------- flake.nix | 11 +++--- init.org | 7 ++-- nix/inputOverrides.nix | 13 ------- nix/packageOverrides.nix | 10 ------ 7 files changed, 90 insertions(+), 120 deletions(-) diff --git a/default.nix b/default.nix index 352c7573..9c652515 100644 --- a/default.nix +++ b/default.nix @@ -1,7 +1,8 @@ { lib, stdenv, - trivialBuild, + buildElispPackage, + elispInputs, emacs-all-the-icons-fonts, emacsPackages, iosevka-bin, @@ -11,41 +12,36 @@ let tree-sitter = emacsPackages.treesit-grammars.with-all-grammars; - init = trivialBuild { - pname = "config-init"; - version = "1"; + init = buildElispPackage { + ename = "config-init"; src = lib.sourceByRegex ./. [ "init.org" ]; + files = [ "init.org" ]; + lispFiles = [ + "early-init.el" + "init.el" + ]; + + inherit elispInputs; + nativeCompileAhead = true; + wantExtraOutputs = false; + errorOnWarn = true; + doTangle = false; preBuild = '' + export HOME="$NIX_BUILD_TOP/.home" + mkdir -p "$HOME/.config/emacs" + emacs --batch --quick \ --load org \ *.org \ --funcall org-babel-tangle - ''; - - buildPhase = '' - runHook preBuild - - export HOME="$(mktemp -d)" + rm *.org - mkdir -p "$HOME/.emacs.d" - ln -s ${tree-sitter}/lib "$HOME/.emacs.d/tree-sitter" - - emacs --batch --quick \ - --eval '(setq byte-compile-error-on-warn t)' \ - --funcall batch-byte-compile \ - *.el - - runHook postBuild + ln -s ${tree-sitter}/lib "$HOME/.config/emacs/tree-sitter" ''; - # Temporary hack because the Emacs native load path is not respected. - fixupPhase = '' - if [ -d "$HOME/.emacs.d/eln-cache" ]; then - mv $HOME/.emacs.d/eln-cache/* $out/share/emacs/native-lisp - fi - ''; + meta = { }; }; in stdenv.mkDerivation { diff --git a/dev/flake.lock b/dev/flake.lock index c5d5f2f7..0b275978 100644 --- a/dev/flake.lock +++ b/dev/flake.lock @@ -1,23 +1,7 @@ { "nodes": { - "call-flake": { - "locked": { - "lastModified": 1725759995, - "narHash": "sha256-ythzL6iO/eE6r1IA6dflpWx0vC4JBGBlHLTK3BpYhrQ=", - "owner": "divnix", - "repo": "call-flake", - "rev": "1649c3e8c1d3def27a3c6414f246c6d15d5ba7c1", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "call-flake", - "type": "github" - } - }, "dev-flake": { "inputs": { - "call-flake": "call-flake", "devshell": "devshell", "flake-parts": "flake-parts", "git-hooks": "git-hooks", @@ -27,11 +11,11 @@ "treefmt": "treefmt" }, "locked": { - "lastModified": 1727703689, - "narHash": "sha256-h7YesCBK+6Rle+1/TgW/HT4DVtqfq0qFm7eSAS1B+do=", + "lastModified": 1729491256, + "narHash": "sha256-4sJV4O9MO7VNsxcUs+zNeyeE5R+3SBNxps2F3hAhh7U=", "owner": "terlar", "repo": "dev-flake", - "rev": "c9e255f8d2d0120adb6fb800c39cb4995373b360", + "rev": "3d2178d5d7ffd518d9434a82b9288ffa4429e0a5", "type": "github" }, "original": { @@ -48,11 +32,11 @@ ] }, "locked": { - "lastModified": 1722113426, - "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", + "lastModified": 1728330715, + "narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=", "owner": "numtide", "repo": "devshell", - "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", + "rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef", "type": "github" }, "original": { @@ -95,17 +79,14 @@ }, "flake-parts": { "inputs": { - "nixpkgs-lib": [ - "dev-flake", - "nixpkgs" - ] + "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1725234343, - "narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=", + "lastModified": 1727826117, + "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "567b938d64d4b4112ee253b9274472dc3a346eb6", + "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", "type": "github" }, "original": { @@ -128,11 +109,11 @@ ] }, "locked": { - "lastModified": 1725513492, - "narHash": "sha256-tyMUA6NgJSvvQuzB7A1Sf8+0XCHyfSPRx/b00o6K0uo=", + "lastModified": 1729104314, + "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "7570de7b9b504cfe92025dd1be797bf546f66528", + "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", "type": "github" }, "original": { @@ -170,11 +151,11 @@ ] }, "locked": { - "lastModified": 1728041527, - "narHash": "sha256-03liqiJtk9UP7YQHW4r8MduKCK242FQzud8iWvvlK+o=", + "lastModified": 1729894599, + "narHash": "sha256-nL9nzNE5/re/P+zOv7NX6bRm5e+DeS1HIufQUJ01w20=", "owner": "nix-community", "repo": "home-manager", - "rev": "509dbf8d45606b618e9ec3bbe4e936b7c5bc6c1e", + "rev": "93435d27d250fa986bfec6b2ff263161ff8288cb", "type": "github" }, "original": { @@ -185,11 +166,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728018373, - "narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=", + "lastModified": 1729665710, + "narHash": "sha256-AlcmCXJZPIlO5dmFzV3V2XF6x/OpNWUV8Y/FMPGd8Z4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bc947f541ae55e999ffdb4013441347d83b00feb", + "rev": "2768c7d042a37de65bb1b5b3268fc987e534c49d", "type": "github" }, "original": { @@ -199,6 +180,18 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1727825735, + "narHash": "sha256-0xHYkMkeLVQAMa7gvkddbPqpxph+hDzdu1XdGPJR+Os=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" + } + }, "root": { "inputs": { "dev-flake": "dev-flake", @@ -215,11 +208,11 @@ ] }, "locked": { - "lastModified": 1725271838, - "narHash": "sha256-VcqxWT0O/gMaeWTTjf1r4MOyG49NaNxW4GHTO3xuThE=", + "lastModified": 1729242555, + "narHash": "sha256-6jWSWxv2crIXmYSEb3LEVsFkCkyVHNllk61X4uhqfCs=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "9fb342d14b69aefdf46187f6bb80a4a0d97007cd", + "rev": "d986489c1c757f6921a48c1439f19bfb9b8ecab5", "type": "github" }, "original": { diff --git a/flake.lock b/flake.lock index a293fca2..5bd9e163 100644 --- a/flake.lock +++ b/flake.lock @@ -27,11 +27,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1728234711, - "narHash": "sha256-wx6dR0PXKo5UEaa2HObGNqy8pPIFn2Lm+DTzWnmP/X8=", + "lastModified": 1729964113, + "narHash": "sha256-ZDST68C0+5+PbTDPVzErW5zxYiZzOwdHqb+E472qGQo=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "d83373c669b43b08219d63270662ab6585aeec6c", + "rev": "5f83b15a9fe67d4dd1edcd281194d4d30925125a", "type": "github" }, "original": { @@ -95,11 +95,11 @@ "gnu-elpa": { "flake": false, "locked": { - "lastModified": 1726495031, - "narHash": "sha256-XHXE3FcoK2qpaYqzjRVGSt1BUOYRmGu5YnZydmMoGzE=", + "lastModified": 1729668016, + "narHash": "sha256-KwmuWEKQoT5SPxmWHQpSNJ6FP7UoVs71Vv3n+x5HXjs=", "ref": "main", - "rev": "28b18a087b5394d71f5014d3295fb312aa79de25", - "revCount": 634, + "rev": "fc29988d84e27414dc5bccc3585acb506079631d", + "revCount": 635, "shallow": false, "type": "git", "url": "https://git.savannah.gnu.org/git/emacs/elpa.git" @@ -114,11 +114,11 @@ "melpa": { "flake": false, "locked": { - "lastModified": 1728250916, - "narHash": "sha256-KeSyYRZmUiKX1+jD+BXyKN69zOuPbNpdzwsOViLcyzo=", + "lastModified": 1729542131, + "narHash": "sha256-/kG/kFBkUatMZ51HZoXhM09V0YF0j5Mh5xojrfeKGcM=", "owner": "melpa", "repo": "melpa", - "rev": "66011b5520df38daf9ba775c3ad80ba779f8835e", + "rev": "da35f12c860f23961f46eb5ff22e526d6fa6fb6f", "type": "github" }, "original": { @@ -129,11 +129,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728228884, - "narHash": "sha256-E9JaDKGi21oUypH0P9881lbkhi6USNJ6XL2tFzU5uuE=", + "lastModified": 1729939720, + "narHash": "sha256-F7jTiYAxLF0Hcv92Xa5dIufzH1plmS9nbwO50j/9Kxw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ff0da78cfd41aa1784910ce1fea89119822013ce", + "rev": "c93e398e719021a9ad9da56af1589d23029f3cea", "type": "github" }, "original": { @@ -145,7 +145,7 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1727988898, + "lastModified": 1727825735, "narHash": "sha256-0xHYkMkeLVQAMa7gvkddbPqpxph+hDzdu1XdGPJR+Os=", "type": "tarball", "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" @@ -157,11 +157,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1728193676, - "narHash": "sha256-PbDWAIjKJdlVg+qQRhzdSor04bAPApDqIv2DofTyynk=", + "lastModified": 1729691686, + "narHash": "sha256-BAuPWW+9fa1moZTU+jFh+1cUtmsuF8asgzFwejM4wac=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6", + "rev": "32e940c7c420600ef0d1ef396dc63b04ee9cad37", "type": "github" }, "original": { @@ -174,11 +174,11 @@ "nongnu-elpa": { "flake": false, "locked": { - "lastModified": 1728137453, - "narHash": "sha256-DDYqR6YxMzbn60zg1l8KFSozfCXEcN6Q4xBqGiXjIT8=", + "lastModified": 1729285674, + "narHash": "sha256-7MXOvX2bjwBrjQ0prUm3WBOk12F3ffKNTm5THV9a4gA=", "ref": "main", - "rev": "bcdbd55cafa7b1acb354a8a2e0fb9514c220ed6f", - "revCount": 332, + "rev": "4b8b3633c7e29412c89f1c9d6ad7a951772be758", + "revCount": 333, "shallow": false, "type": "git", "url": "https://git.savannah.gnu.org/git/emacs/nongnu.git" @@ -237,11 +237,11 @@ "elisp-helpers": "elisp-helpers" }, "locked": { - "lastModified": 1728192117, - "narHash": "sha256-0SxEBHTL0A4Vl/Fo3NtX/rQQjeIqCnOdp0Od37DPZ1o=", + "lastModified": 1728388405, + "narHash": "sha256-0alqrwms3YIssJ/g8xArypaSnGcnmgszouFlwZUbY6s=", "owner": "emacs-twist", "repo": "twist.nix", - "rev": "629e831d8dc7c6919642fe8b7c1fa99999652ecd", + "rev": "97165e9a989ea429928866df95fe09f4c096e3c2", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 563c3d87..0925f8a4 100644 --- a/flake.nix +++ b/flake.nix @@ -89,11 +89,14 @@ ); emacs-config = prev.callPackage inputs.self { - trivialBuild = final.emacsPackages.trivialBuild.override { - emacs = final.emacs-env.overrideScope ( - _: tprev: { inherit (tprev.emacs) meta withNativeCompilation; } - ); + buildElispPackage = (inputs.twist.lib.buildElispPackage final).override { + emacs = emacsPackage; }; + + elispInputs = prev.lib.pipe final.emacs-env.elispPackages [ + builtins.attrValues + (builtins.filter prev.lib.isDerivation) + ]; }; } ) diff --git a/init.org b/init.org index 3c3233a5..4db168b8 100644 --- a/init.org +++ b/init.org @@ -1661,8 +1661,8 @@ Descriptive buffer names or project relative paths for buffer names. (shell-mode-hook . epithet-rename-buffer) :config (defun epithet-relative-project-name () - (when-let ((project (project-current)) - (buffer-file-name (buffer-file-name))) + (when-let* ((project (project-current)) + (buffer-file-name (buffer-file-name))) (let* ((project-root (expand-file-name (project-root project))) (prefix (file-name-directory (directory-file-name project-root))) (buffer (expand-file-name buffer-file-name))) @@ -2926,7 +2926,7 @@ Add faces to =outline-minor-mode= in order to make the headings stand out. (defun clojure-repl () "Open a Clojure REPL." (interactive) - (if-let ((repl-buffer (cider-current-repl))) + (if-let* ((repl-buffer (cider-current-repl))) (pop-to-buffer repl-buffer) (cider-jack-in-clj nil))) @@ -3503,6 +3503,7 @@ Pretty check-boxes (use-package racket-mode :ensure t :mode "\\.rkt[dl]?\\'" + :bind (:map racket-mode-map ("M-g k" . racket-doc) ("C-. t" . racket-test)) diff --git a/nix/inputOverrides.nix b/nix/inputOverrides.nix index d63bca40..94a60b03 100644 --- a/nix/inputOverrides.nix +++ b/nix/inputOverrides.nix @@ -1,18 +1,5 @@ { lib, ... }: { - bbdb = _: prev: { - files = - (builtins.removeAttrs prev.files [ - # Unused integrations. - "lisp/bbdb-notmuch.el" - "lisp/bbdb-vm.el" - "lisp/bbdb-vm-aux.el" - ]) - // { - "lisp/bbdb-site.el.in" = "bbdb-site.el.in"; - }; - }; - ghelp = _: prev: { files = builtins.removeAttrs prev.files [ # Unused integrations. diff --git a/nix/packageOverrides.nix b/nix/packageOverrides.nix index 8c307151..ab860d57 100644 --- a/nix/packageOverrides.nix +++ b/nix/packageOverrides.nix @@ -9,16 +9,6 @@ unzip, }: _final: prev: { - bbdb = prev.bbdb.overrideAttrs (old: { - preBuild = '' - substituteInPlace bbdb-site.el.in \ - --replace "@pkgdatadir@" $out/share/emacs/site-lisp/tex/ \ - --replace "@PACKAGE_VERSION@" ${old.version}; - - mv bbdb-site.el{.in,} - ''; - }); - jinx = prev.jinx.overrideAttrs ( old: let