feat: emacs config
This commit is contained in:
parent
0251529a8a
commit
91587da1cb
4 changed files with 102 additions and 8 deletions
11
home-manager/emacs/doom/early-init.el
Normal file
11
home-manager/emacs/doom/early-init.el
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
;;; early-init.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Set the background early to prevent the white flash
|
||||||
|
(setq default-frame-alist
|
||||||
|
'((background-color . "#282c34") ; Standard Doom One background
|
||||||
|
(vertical-scroll-bars . nil)
|
||||||
|
(tool-bar-lines . 0)
|
||||||
|
(menu-bar-lines . 0)))
|
||||||
|
|
||||||
|
;; Ensure the title bar is dark on macOS/compatible systems
|
||||||
|
(add-to-list 'default-frame-alist '(ns-appearance . dark))
|
||||||
|
|
@ -105,7 +105,7 @@
|
||||||
magit ; a git porcelain for Emacs
|
magit ; a git porcelain for Emacs
|
||||||
;;make ; run make tasks from Emacs
|
;;make ; run make tasks from Emacs
|
||||||
pass ; password manager for nerds
|
pass ; password manager for nerds
|
||||||
;;pdf ; pdf enhancements
|
(pdf +org) ; pdf enhancements
|
||||||
;;terraform ; infrastructure as code
|
;;terraform ; infrastructure as code
|
||||||
;;tmux ; an API for interacting with tmux
|
;;tmux ; an API for interacting with tmux
|
||||||
tree-sitter ; syntax and parsing, sitting in a tree...
|
tree-sitter ; syntax and parsing, sitting in a tree...
|
||||||
|
|
@ -172,7 +172,7 @@
|
||||||
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
|
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
|
||||||
;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
||||||
;;scala ; java, but good
|
;;scala ; java, but good
|
||||||
(scheme +guile) ; a fully conniving family of lisps
|
(scheme +guile +chez) ; a fully conniving family of lisps
|
||||||
sh ; she sells {ba,z,fi}sh shells on the C xor
|
sh ; she sells {ba,z,fi}sh shells on the C xor
|
||||||
;;sml
|
;;sml
|
||||||
;;solidity ; do you need a blockchain? No.
|
;;solidity ; do you need a blockchain? No.
|
||||||
|
|
@ -192,8 +192,8 @@
|
||||||
;;calendar
|
;;calendar
|
||||||
;;emms
|
;;emms
|
||||||
;;everywhere ; *leave* Emacs!? You must be joking
|
;;everywhere ; *leave* Emacs!? You must be joking
|
||||||
;;irc ; how neckbeards socialize
|
irc ; how neckbeards socialize
|
||||||
;;(rss +org) ; emacs as an RSS reader
|
(rss +org) ; emacs as an RSS reader
|
||||||
|
|
||||||
:config
|
:config
|
||||||
;;literate
|
;;literate
|
||||||
|
|
|
||||||
|
|
@ -4,26 +4,96 @@ let
|
||||||
comfyuiSrc = pkgs.fetchFromGitHub {
|
comfyuiSrc = pkgs.fetchFromGitHub {
|
||||||
owner = "Comfy-Org";
|
owner = "Comfy-Org";
|
||||||
repo = "ComfyUI";
|
repo = "ComfyUI";
|
||||||
rev = "master";
|
rev = "v0.9.2";
|
||||||
sha256 = "PQfZ0PD/PQn49ElGdzt/El8JrU7clETcLi/6ZUxm8f8=";
|
sha256 = "PQfZ0PD/PQn49ElGdzt/El8JrU7clETcLi/6ZUxm8f8=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
controlnetAux = pkgs.fetchFromGitHub {
|
||||||
|
owner = "Fannovel16";
|
||||||
|
repo = "comfyui_controlnet_aux";
|
||||||
|
rev = "136f125c89aed92ced1b6fbb491e13719b72fcc0";
|
||||||
|
sha256 = "DlspkqzN7Ls8kXWQMtVQygzsgu/z6FtjMqDthuza/Kc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
ipAdapter = pkgs.fetchFromGitHub {
|
||||||
|
owner = "cubiq";
|
||||||
|
repo = "ComfyUI_IPAdapter_plus";
|
||||||
|
rev = "main";
|
||||||
|
sha256 = "Ft9WJcmjzon2tAMJq5na24iqYTnQWEQFSKUElSVwYgw=";
|
||||||
|
};
|
||||||
|
|
||||||
|
toolingNodes = pkgs.fetchFromGitHub {
|
||||||
|
owner = "Acly";
|
||||||
|
repo = "comfyui-tooling-nodes";
|
||||||
|
rev = "main";
|
||||||
|
sha256 = "tVvpVWDpihy7zdV/L7cOpsWE68l15xKIwuM3EriUM+Y=";
|
||||||
|
};
|
||||||
|
|
||||||
|
inpaintNodes = pkgs.fetchFromGitHub {
|
||||||
|
owner = "Acly";
|
||||||
|
repo = "comfyui-inpaint-nodes";
|
||||||
|
rev = "main";
|
||||||
|
sha256 = "Uy6ppXNAQAOIkmoJB8miAzVUXZ0Elyp+w+kwNxWZjvo=";
|
||||||
|
};
|
||||||
|
|
||||||
dataDir = "${config.home.homeDirectory}/.local/share/comfyui";
|
dataDir = "${config.home.homeDirectory}/.local/share/comfyui";
|
||||||
venvDir = "${dataDir}/.venv";
|
venvDir = "${dataDir}/.venv";
|
||||||
|
customNodesDir = "${dataDir}/custom_nodes";
|
||||||
|
kritaModelsDir = "${config.home.homeDirectory}/.var/app/org.kde.krita/data/krita/ai_diffusion/server/models";
|
||||||
|
|
||||||
startScript = pkgs.writeShellScript "comfyui-start" ''
|
startScript = pkgs.writeShellScript "comfyui-start" ''
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
export LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib:${pkgs.zlib}/lib:${pkgs.libGL}/lib:/run/opengl-driver/lib:$LD_LIBRARY_PATH"
|
export LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib:${pkgs.zlib}/lib:${pkgs.libGL}/lib:${pkgs.glib}/lib:${pkgs.xorg.libxcb}/lib:${pkgs.xorg.libX11}/lib:${pkgs.xorg.libXext}/lib:/run/opengl-driver/lib:$LD_LIBRARY_PATH"
|
||||||
|
|
||||||
mkdir -p ${dataDir}
|
mkdir -p ${dataDir}
|
||||||
|
mkdir -p ${customNodesDir}
|
||||||
|
|
||||||
# Copy source if not exists or update
|
# Copy source if not exists
|
||||||
if [ ! -f "${dataDir}/main.py" ]; then
|
if [ ! -f "${dataDir}/main.py" ]; then
|
||||||
cp -r ${comfyuiSrc}/* ${dataDir}/
|
cp -r ${comfyuiSrc}/* ${dataDir}/
|
||||||
chmod -R u+w ${dataDir}
|
chmod -R u+w ${dataDir}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Create extra_model_paths.yaml to use Krita AI Diffusion models
|
||||||
|
cat > ${dataDir}/extra_model_paths.yaml << EOF
|
||||||
|
krita_ai:
|
||||||
|
base_path: ${kritaModelsDir}
|
||||||
|
checkpoints: checkpoints/
|
||||||
|
clip_vision: clip_vision/
|
||||||
|
controlnet: controlnet/
|
||||||
|
diffusion_models: diffusion_models/
|
||||||
|
embeddings: embeddings/
|
||||||
|
inpaint: inpaint/
|
||||||
|
ipadapter: ipadapter/
|
||||||
|
loras: loras/
|
||||||
|
style_models: style_models/
|
||||||
|
text_encoders: text_encoders/
|
||||||
|
upscale_models: upscale_models/
|
||||||
|
vae: vae/
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Install custom nodes
|
||||||
|
if [ ! -d "${customNodesDir}/comfyui_controlnet_aux" ]; then
|
||||||
|
cp -r ${controlnetAux} ${customNodesDir}/comfyui_controlnet_aux
|
||||||
|
chmod -R u+w ${customNodesDir}/comfyui_controlnet_aux
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "${customNodesDir}/ComfyUI_IPAdapter_plus" ]; then
|
||||||
|
cp -r ${ipAdapter} ${customNodesDir}/ComfyUI_IPAdapter_plus
|
||||||
|
chmod -R u+w ${customNodesDir}/ComfyUI_IPAdapter_plus
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "${customNodesDir}/comfyui-tooling-nodes" ]; then
|
||||||
|
cp -r ${toolingNodes} ${customNodesDir}/comfyui-tooling-nodes
|
||||||
|
chmod -R u+w ${customNodesDir}/comfyui-tooling-nodes
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "${customNodesDir}/comfyui-inpaint-nodes" ]; then
|
||||||
|
cp -r ${inpaintNodes} ${customNodesDir}/comfyui-inpaint-nodes
|
||||||
|
chmod -R u+w ${customNodesDir}/comfyui-inpaint-nodes
|
||||||
|
fi
|
||||||
|
|
||||||
cd ${dataDir}
|
cd ${dataDir}
|
||||||
|
|
||||||
# Create venv on first run
|
# Create venv on first run
|
||||||
|
|
@ -32,13 +102,25 @@ let
|
||||||
${venvDir}/bin/pip install --upgrade pip
|
${venvDir}/bin/pip install --upgrade pip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Always ensure deps are installed
|
# Install deps
|
||||||
if [ ! -f "${venvDir}/.deps-installed" ]; then
|
if [ ! -f "${venvDir}/.deps-installed" ]; then
|
||||||
${venvDir}/bin/pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu124
|
${venvDir}/bin/pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu124
|
||||||
${venvDir}/bin/pip install -r requirements.txt
|
${venvDir}/bin/pip install -r requirements.txt
|
||||||
touch ${venvDir}/.deps-installed
|
touch ${venvDir}/.deps-installed
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Install custom nodes deps
|
||||||
|
if [ ! -f "${venvDir}/.custom-nodes-installed" ]; then
|
||||||
|
for node in ${customNodesDir}/*/; do
|
||||||
|
if [ -f "$node/requirements.txt" ]; then
|
||||||
|
# Replace opencv-python with headless version (no GUI deps)
|
||||||
|
sed 's/opencv-python>=/opencv-python-headless>=/g' "$node/requirements.txt" > /tmp/requirements_patched.txt
|
||||||
|
${venvDir}/bin/pip install -r /tmp/requirements_patched.txt || true
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
touch ${venvDir}/.custom-nodes-installed
|
||||||
|
fi
|
||||||
|
|
||||||
exec ${venvDir}/bin/python main.py "$@"
|
exec ${venvDir}/bin/python main.py "$@"
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,4 @@
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue