mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2026-07-16 22:21:55 +08:00
feat: write script that installs doom emacs
This commit is contained in:
parent
38233892e7
commit
35cbb89a26
3 changed files with 50 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ (import ./git.nix) ]
|
[ (import ./git.nix) ]
|
||||||
|
++ [ (import ./doom-emacs.nix) ]
|
||||||
++ [ (import ./swaync/default.nix) ]
|
++ [ (import ./swaync/default.nix) ]
|
||||||
++ [ (import ./sway/default.nix) ]
|
++ [ (import ./sway/default.nix) ]
|
||||||
++ [ (import ./fonts.nix) ]
|
++ [ (import ./fonts.nix) ]
|
||||||
|
|
|
||||||
47
modules/home/doom-emacs.nix
Normal file
47
modules/home/doom-emacs.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
username,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
emacsdir = "/home/${username}/.config/emacs";
|
||||||
|
doom-install = pkgs.writeShellApplication {
|
||||||
|
name = "doom-install";
|
||||||
|
runtimeInputs = [ config.programs.git.package ];
|
||||||
|
text = ''
|
||||||
|
EMACS=${emacsdir}
|
||||||
|
|
||||||
|
if [ ! -f "$EMACS/bin/doom" ]; then
|
||||||
|
git clone https://github.com/hlissner/doom-emacs.git $EMACS
|
||||||
|
yes | $EMACS/bin/doom install
|
||||||
|
$EMACS/bin/doom sync
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.emacs = {
|
||||||
|
enable = true;
|
||||||
|
package = (pkgs.emacsPackagesFor pkgs.emacs).emacsWithPackages (epkgs: [
|
||||||
|
epkgs.vterm
|
||||||
|
epkgs.treesit-grammars.with-all-grammars
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
|
# add doom to path
|
||||||
|
home = {
|
||||||
|
# sessionVariables = {
|
||||||
|
# PATH = [ "$HOME/.config/emacs/bin" ];
|
||||||
|
# DOOMDIR = "/home/${username}/flake/modules/home/doom-config/";
|
||||||
|
# };
|
||||||
|
|
||||||
|
packages = [
|
||||||
|
doom-install
|
||||||
|
pkgs.emacs
|
||||||
|
pkgs.shellcheck
|
||||||
|
pkgs.symbola
|
||||||
|
pkgs.nerd-fonts.symbols-only
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -52,7 +52,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
initContent = ''
|
initContent = ''
|
||||||
export PATH="''${PATH}:''${HOME}/.local/bin/:''${HOME}/.cargo/bin/:''${HOME}/.fzf/bin/"
|
export PATH="''${PATH}:''${HOME}/.local/bin/:''${HOME}/.cargo/bin/:''${HOME}/.fzf/bin/:''${HOME}/.config/emacs/bin"
|
||||||
|
export DOOMDIR="''${HOME}/flake/modules/home/doom-config/";
|
||||||
|
|
||||||
preview_cmd='
|
preview_cmd='
|
||||||
if file --mime-type {} | grep -qF image/; then
|
if file --mime-type {} | grep -qF image/; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue