diff --git a/flake.lock b/flake.lock index 9cc395e..f21fc5f 100644 --- a/flake.lock +++ b/flake.lock @@ -19,6 +19,21 @@ "type": "github" } }, + "nix-org-babel": { + "locked": { + "lastModified": 1731256202, + "narHash": "sha256-xtV0vIUhl3ZUzaUIHSaiWpybxyCgQ9Yp/MUGo3f5zvM=", + "owner": "emacs-twist", + "repo": "org-babel", + "rev": "a5d16c54aca35c07af59d216cda598163512db42", + "type": "github" + }, + "original": { + "owner": "emacs-twist", + "repo": "org-babel", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1737885589, @@ -70,6 +85,7 @@ "root": { "inputs": { "emacs-overlay": "emacs-overlay", + "nix-org-babel": "nix-org-babel", "nixpkgs": "nixpkgs_2" } } diff --git a/flake.nix b/flake.nix index b632c25..65e55b9 100644 --- a/flake.nix +++ b/flake.nix @@ -8,36 +8,50 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; emacs-overlay.url = "github:nix-community/emacs-overlay"; + nix-org-babel.url = "github:emacs-twist/org-babel"; }; outputs = { self, nixpkgs, emacs-overlay, + nix-org-babel, }: { packages.x86_64-linux.default = import ./package.nix { pkgs = import nixpkgs { system = "x86_64-linux"; - overlays = [emacs-overlay.overlays.default]; + overlays = [ + emacs-overlay.overlays.default + nix-org-babel.overlays.default + ]; }; }; packages.aarch64-linux.default = import ./package.nix { pkgs = import nixpkgs { system = "aarch64-linux"; - overlays = [emacs-overlay.overlays.default]; + overlays = [ + emacs-overlay.overlays.default + nix-org-babel.overlays.default + ]; }; }; packages.x86_64-linux.x11 = import ./package.nix { pkgs = import nixpkgs { system = "x86_64-linux"; - overlays = [emacs-overlay.overlays.default]; + overlays = [ + emacs-overlay.overlays.default + nix-org-babel.overlays.default + ]; }; x11 = true; }; packages.aarch64-linux.x11 = import ./package.nix { pkgs = import nixpkgs { system = "aarch64-linux"; - overlays = [emacs-overlay.overlays.default]; + overlays = [ + emacs-overlay.overlays.default + nix-org-babel.overlays.default + ]; }; x11 = true; }; diff --git a/package.nix b/package.nix index 887b5f0..7aee328 100644 --- a/package.nix +++ b/package.nix @@ -26,15 +26,9 @@ in # src = ./emacs.el; # inherit (config.xdg) configHome dataHome; # }; - defaultInitFile = pkgs.substituteAll { - name = "default.el"; - src = pkgs.writeText "init.el" '' - ;;; -*- lexical-binding: t; -*- - (org-babel-load-file - ${./config.org}) - ''; + defaultInitFile = pkgs.tangleOrgBabelFile "default.el" ./config.org { + languages = ["emacs-lisp"]; }; - # Package is optional, defaults to pkgs.emacs package = emacs;