Add emacs

This commit is contained in:
outfoxxed 2023-06-27 15:37:18 -07:00
parent f7da38b9e4
commit 00cbab381d
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
5 changed files with 153 additions and 4 deletions

View file

@ -1,15 +1,40 @@
{ {
"nodes": { "nodes": {
"emacs-overlay": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1686301695,
"narHash": "sha256-Ma0XINJkbKRRsl4RSCm4wEgCTWFs0UHCLpG7j9GSt5I=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "b7a065e692e944e6b68d4285013ca426a8de6663",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "b7a065e692e944e6b68d4285013ca426a8de6663",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1681202837, "lastModified": 1687709756,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401", "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -137,6 +162,22 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs-stable": {
"locked": {
"lastModified": 1686237827,
"narHash": "sha256-fAZB+Zkcmc+qlauiFnIH9+2qgwM0NO/ru5pWEw3tDow=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "81ed90058a851eb73be835c770e062c6938c8a9e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1687838990, "lastModified": 1687838990,
@ -154,6 +195,8 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"emacs-overlay": "emacs-overlay",
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"hyprland-hy3": "hyprland-hy3", "hyprland-hy3": "hyprland-hy3",
@ -166,7 +209,9 @@
}, },
"rust-overlay": { "rust-overlay": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": [
"flake-utils"
],
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]

View file

@ -2,12 +2,19 @@
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable"; nixpkgs.url = "nixpkgs/nixos-unstable";
stable.url = "nixpkgs/nixos-23.05"; stable.url = "nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
emacs-overlay = {
url = "github:nix-community/emacs-overlay?rev=b7a065e692e944e6b68d4285013ca426a8de6663";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
hyprland = { hyprland = {
url = "github:hyprwm/Hyprland"; url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -29,6 +36,7 @@
rust-overlay = { rust-overlay = {
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
}; };
}; };

View file

@ -3,12 +3,19 @@
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable"; nixpkgs.url = "nixpkgs/nixos-unstable";
stable.url = "nixpkgs/nixos-23.05"; stable.url = "nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
emacs-overlay = {
url = "github:nix-community/emacs-overlay?rev=b7a065e692e944e6b68d4285013ca426a8de6663";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
hyprland = { hyprland = {
url = "github:hyprwm/Hyprland"; url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -30,6 +37,7 @@
rust-overlay = { rust-overlay = {
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
}; };
}; };

87
modules/emacs/default.nix Normal file
View file

@ -0,0 +1,87 @@
{ inputs, config, pkgs, ... }: let
newpkgs = pkgs.appendOverlays
(with inputs.emacs-overlay.overlays; [ emacs package ]);
tree-sitter-parsers = grammars: with grammars; [
tree-sitter-bash
tree-sitter-c
tree-sitter-c-sharp
tree-sitter-cmake
tree-sitter-cpp
tree-sitter-css
tree-sitter-dot
tree-sitter-elisp
tree-sitter-glsl
tree-sitter-html
tree-sitter-java
tree-sitter-javascript
tree-sitter-json
tree-sitter-json5
tree-sitter-kotlin
tree-sitter-latex
tree-sitter-llvm
tree-sitter-lua
tree-sitter-make
tree-sitter-markdown
tree-sitter-markdown-inline
tree-sitter-nickel
tree-sitter-nix
tree-sitter-prisma
tree-sitter-python
tree-sitter-regex
tree-sitter-rust
tree-sitter-scss
tree-sitter-sql
tree-sitter-toml
tree-sitter-tsx
tree-sitter-typescript
tree-sitter-vim
tree-sitter-yaml
];
custom-emacs =
with newpkgs;
((emacsPackagesFor emacs-unstable).emacsWithPackages (epkgs: with epkgs; [
avy
company
cmake-font-lock
direnv
editorconfig
evil
evil-collection
evil-goggles
face-explorer
flycheck
frames-only-mode
fussy
kotlin-mode
lsp-mode
lsp-treemacs
lsp-ui
magit
markdown-mode
nasm-mode
nix-mode reformatter # required by nix mode
projectile
rainbow-mode
string-inflection
(treesit-grammars.with-grammars (grammars: tree-sitter-parsers grammars))
treemacs
treemacs-evil
treemacs-projectile
treemacs-magit
use-package
vertico
which-key
ws-butler
]));
in {
home-manager.users.${config.main-user} = {
home.packages = [ custom-emacs ];
services.emacs = {
enable = true;
package = custom-emacs;
};
};
}

View file

@ -4,6 +4,7 @@
./theme ./theme
./overlay-pkgs ./overlay-pkgs
./user ./user
./emacs
]; ];
programs.dconf.enable = true; programs.dconf.enable = true;