diff --git a/flake.lock b/flake.lock index 9e3ccc9..0dac449 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "emacs-overlay": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs-unstable" + ] + }, + "locked": { + "lastModified": 1659638214, + "narHash": "sha256-lXa01G06Ey9qgj+rYN7Nzc53FP3p2UMMnAuxpWXu9Ko=", + "owner": "nix-community", + "repo": "emacs-overlay", + "rev": "a151f9ff5b9fa813ac8918f3a3a67c643e7e2edc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "emacs-overlay", + "type": "github" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -22,6 +43,21 @@ } }, "flake-utils": { + "locked": { + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "locked": { "lastModified": 1653893745, "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", @@ -38,7 +74,7 @@ }, "microvm": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ] @@ -107,6 +143,7 @@ }, "root": { "inputs": { + "emacs-overlay": "emacs-overlay", "fenix": "fenix", "microvm": "microvm", "nixpkgs": "nixpkgs", diff --git a/flake.nix b/flake.nix index 2b85bb2..816b41a 100644 --- a/flake.nix +++ b/flake.nix @@ -14,10 +14,15 @@ url = github:nix-community/fenix; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; + emacs-overlay = { + url = github:nix-community/emacs-overlay; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; }; outputs = inputs@{ self + , emacs-overlay , nixpkgs , nixpkgs-unstable , sops-nix @@ -35,6 +40,7 @@ ./modules/basic-tools.nix ./modules/binary-caches.nix ./modules/chromium.nix + ./modules/emacs.nix ./modules/gnupg.nix ./modules/graphical.nix ./modules/hw-accel-intel.nix @@ -42,6 +48,9 @@ ./modules/radio.nix ./modules/science.nix ./modules/tlp.nix + { + nixpkgs.overlays = [ emacs-overlay.overlay ]; + } ({ pkgs, ... }: { nixpkgs.overlays = [ fenix.overlay ]; environment.systemPackages = with pkgs; [ diff --git a/modules/emacs.nix b/modules/emacs.nix index 52fdc52..30332cf 100644 --- a/modules/emacs.nix +++ b/modules/emacs.nix @@ -1,20 +1,24 @@ -{ lib, pkgs, ... }: +{ pkgs, ... }: { environment.systemPackages = with pkgs; [ - # language servers - clang-tools - clang - - sqlite - graphviz + direnv ]; + programs.zsh.shellInit = '' + eval "$(direnv hook zsh)" + ''; + programs.bash.shellInit = '' + eval "$(direnv hook bash)" + ''; + + services.emacs = { install = true; enable = false; - # pure gtk, native compiled emacs with vterm and pdf-tools - package = with pkgs; ((emacsPackagesFor emacs).emacsWithPackages (epkgs: [ epkgs.vterm ])); + package = with pkgs; ((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages (epkgs: with epkgs; [ + vterm + ])); defaultEditor = false; };