Regenerated
This commit is contained in:
@@ -513,6 +513,76 @@ This sets up the zsh in the terminal
|
|||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
** =generated/modules/traveldroid/apps/emacs/emacs.nix=
|
||||||
|
This installs emacs
|
||||||
|
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/apps/emacs/emacs.nix :noweb tangle :mkdirp yes :eval never-html
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.emacs = {
|
||||||
|
enable = true;
|
||||||
|
# install with tree sitter enabled
|
||||||
|
package = (pkgs.emacs-pgtk.override { withTreeSitter = true; });
|
||||||
|
extraPackages = epkgs: [
|
||||||
|
# also install all tree sitter grammars
|
||||||
|
epkgs.manualPackages.treesit-grammars.with-all-grammars
|
||||||
|
epkgs.nerd-icons # nerd fonts support
|
||||||
|
epkgs.doom-modeline # model line
|
||||||
|
epkgs.diminish # hides modes from modeline
|
||||||
|
epkgs.eldoc # doc support
|
||||||
|
epkgs.pulsar # pulses the cursor when jumping about
|
||||||
|
epkgs.which-key # help porcelain
|
||||||
|
epkgs.expreg # expand region
|
||||||
|
epkgs.vundo # undo tree
|
||||||
|
epkgs.puni # structured editing
|
||||||
|
epkgs.avy # jumping utility
|
||||||
|
epkgs.consult # emacs right click
|
||||||
|
epkgs.vertico # minibuffer completion
|
||||||
|
epkgs.marginalia # annotations for completions
|
||||||
|
epkgs.crux # utilities
|
||||||
|
epkgs.magit # git porcelain
|
||||||
|
epkgs.nerd-icons-corfu # nerd icons for completion
|
||||||
|
epkgs.corfu # completion
|
||||||
|
epkgs.cape # completion extensions
|
||||||
|
epkgs.orderless # search paradigm
|
||||||
|
epkgs.yasnippet # snippets support
|
||||||
|
epkgs.yasnippet-snippets # commonly used snippets
|
||||||
|
epkgs.rg # ripgrep
|
||||||
|
epkgs.exec-path-from-shell # load env and path
|
||||||
|
epkgs.eat # better shell
|
||||||
|
epkgs.rust-mode # rust mode (when rust-ts doesn't cut it)
|
||||||
|
epkgs.rustic # more rust things
|
||||||
|
epkgs.nix-mode # nix lang
|
||||||
|
epkgs.hcl-mode # hashicorp file mode
|
||||||
|
epkgs.shell-pop # quick shell popup
|
||||||
|
epkgs.envrc # support for loading .envrc
|
||||||
|
epkgs.nixpkgs-fmt # format nix files
|
||||||
|
epkgs.f # string + file utilities
|
||||||
|
epkgs.gptel # llm chat (mainly claude)
|
||||||
|
epkgs.catppuccin-theme # catppuccin theme
|
||||||
|
epkgs.eldoc-box # docs in a box
|
||||||
|
epkgs.sideline # mainly for flymake errors on the side
|
||||||
|
epkgs.sideline-flymake # mainly for flymake errors on the side
|
||||||
|
epkgs.sideline-eglot # mainly for flymake errors on the side
|
||||||
|
];
|
||||||
|
};
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = "emacs";
|
||||||
|
XDG_SCREENSHOTS_DIR = "~/screenshots";
|
||||||
|
};
|
||||||
|
home.file = {
|
||||||
|
emacs-init = {
|
||||||
|
source = "${flakeRoot}/assets/traveldroid/conf/emacs/early-init.el";
|
||||||
|
target = ".emacs.d/early-init.el";
|
||||||
|
};
|
||||||
|
emacs = {
|
||||||
|
source = "${flakeRoot}/assets/traveldroid/conf/emacs//init.el";
|
||||||
|
target = ".emacs.d/init.el";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
* generated/modules/traveldroid/desktop
|
* generated/modules/traveldroid/desktop
|
||||||
|
|
||||||
** =generated/modules/traveldroid/desktop/fonts.nix=
|
** =generated/modules/traveldroid/desktop/fonts.nix=
|
||||||
|
|||||||
@@ -1,301 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Droidnix: Complete Emacs setup for Nix/Org tangling, HTML export, and a great editing experience
|
|
||||||
# For NixOS systems
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
|
|
||||||
# Install Emacs and git via nix-shell (no apt-get)
|
|
||||||
if ! command -v emacs &> /dev/null; then
|
|
||||||
echo "Emacs not found. Installing Emacs and git via nix-shell..."
|
|
||||||
nix-shell -p emacs git --run "$0" "$@"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create a minimal Emacs config for package installation
|
|
||||||
TEMP_CONFIG=$(mktemp /tmp/droidnix-emacs-setup.XXXXXX.el)
|
|
||||||
cat > "$TEMP_CONFIG" << 'EOF'
|
|
||||||
;; Minimal config for installing packages
|
|
||||||
(require 'package)
|
|
||||||
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
|
|
||||||
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
|
|
||||||
(package-initialize)
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Install packages in batch mode
|
|
||||||
echo "Installing Emacs packages..."
|
|
||||||
emacs --batch \
|
|
||||||
--load "$TEMP_CONFIG" \
|
|
||||||
--eval "(package-refresh-contents)" \
|
|
||||||
--eval "(package-install 'use-package)" \
|
|
||||||
--eval "(package-install 'org)" \
|
|
||||||
--eval "(package-install 'nix-mode)" \
|
|
||||||
--eval "(package-install 'htmlize)" \
|
|
||||||
--eval "(package-install 'catppuccin-theme)" \
|
|
||||||
--eval "(package-install 'org-bullets)" \
|
|
||||||
--eval "(package-install 'magit)" \
|
|
||||||
--eval "(package-install 'company)" \
|
|
||||||
--eval "(package-install 'flycheck)" \
|
|
||||||
--eval "(package-install 'doom-modeline)" \
|
|
||||||
--eval "(package-install 'which-key)" \
|
|
||||||
--eval "(package-install 'projectile)" \
|
|
||||||
--eval "(package-install 'ivy)" \
|
|
||||||
--eval "(package-install 'counsel)" \
|
|
||||||
--eval "(package-install 'all-the-icons)" \
|
|
||||||
--eval "(package-install 'doom-themes)" \
|
|
||||||
--eval "(package-install 'treemacs)" \
|
|
||||||
--eval "(package-install 'lsp-mode)" \
|
|
||||||
--eval "(package-install 'dashboard)"
|
|
||||||
|
|
||||||
# Create a post-install config for interactive use
|
|
||||||
USER_EMACSCONFIG="${HOME}/.emacs.d/init.el"
|
|
||||||
if [ ! -f "$USER_EMACSCONFIG" ]; then
|
|
||||||
mkdir -p "${HOME}/.emacs.d"
|
|
||||||
cat > "$USER_EMACSCONFIG" << 'EOF'
|
|
||||||
;; Droidnix Emacs Configuration for NixOS
|
|
||||||
(require 'package)
|
|
||||||
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
|
|
||||||
(package-initialize)
|
|
||||||
|
|
||||||
;; Basic UI improvements
|
|
||||||
(tool-bar-mode -1) ; Disable toolbar
|
|
||||||
(menu-bar-mode -1) ; Disable menu bar
|
|
||||||
(scroll-bar-mode -1) ; Disable scroll bar
|
|
||||||
(setq inhibit-startup-message t) ; Disable startup message
|
|
||||||
(setq make-backup-files nil) ; Disable backup files
|
|
||||||
(setq auto-save-default nil) ; Disable auto-save files
|
|
||||||
|
|
||||||
;; Enable Catppuccin Mocha theme
|
|
||||||
(when (fboundp 'load-theme)
|
|
||||||
(ignore-errors
|
|
||||||
(load-theme 'catppuccin-mocha t)
|
|
||||||
(setq catppuccin-disable-term-colors nil)
|
|
||||||
(setq catppuccin-enable-bold t)
|
|
||||||
(setq catppuccin-enable-italic t)))
|
|
||||||
|
|
||||||
;; Enable Doom Modeline
|
|
||||||
(when (fboundp 'doom-modeline-mode)
|
|
||||||
(doom-modeline-mode 1))
|
|
||||||
|
|
||||||
;; Enable All The Icons
|
|
||||||
(when (fboundp 'all-the-icons-install-fonts)
|
|
||||||
(all-the-icons-install-fonts)
|
|
||||||
(global-all-the-icons-mode))
|
|
||||||
|
|
||||||
;; Enable Treemacs
|
|
||||||
(when (fboundp 'treemacs)
|
|
||||||
(treemacs-mode)
|
|
||||||
(setq treemacs-width 30)
|
|
||||||
(setq treemacs-position 'left)
|
|
||||||
(setq treemacs-space-between-root-nodes nil)
|
|
||||||
(setq treemacs-indent-level 2)
|
|
||||||
(setq treemacs-file-follow-delay 0.1)
|
|
||||||
(setq treemacs-git-icon-enabled t)
|
|
||||||
(setq treemacs-project-follow t)
|
|
||||||
(setq treemacs-display-project-root t)
|
|
||||||
(setq treemacs-show-hidden-files t))
|
|
||||||
|
|
||||||
;; Enable Company for autocomplete
|
|
||||||
(when (fboundp 'company-mode)
|
|
||||||
(global-company-mode)
|
|
||||||
(setq company-idle-delay 0.1)
|
|
||||||
(setq company-minimum-prefix-length 1))
|
|
||||||
|
|
||||||
;; Enable Flycheck for syntax checking
|
|
||||||
(when (fboundp 'flycheck-mode)
|
|
||||||
(global-flycheck-mode)
|
|
||||||
(setq flycheck-check-syntax-automatically '(save mode-enabled))
|
|
||||||
(setq flycheck-display-errors-delay 0.5))
|
|
||||||
|
|
||||||
;; Enable Ivy + Counsel for better completion
|
|
||||||
(when (fboundp 'ivy-mode)
|
|
||||||
(ivy-mode 1)
|
|
||||||
(setq ivy-use-virtual-buffers t)
|
|
||||||
(setq ivy-count-format "(%d/%d) ")
|
|
||||||
(setq ivy-height 10)
|
|
||||||
(when (fboundp 'counsel-mode)
|
|
||||||
(counsel-mode 1)))
|
|
||||||
|
|
||||||
;; Enable Projectile for project management
|
|
||||||
(when (fboundp 'projectile-mode)
|
|
||||||
(projectile-mode +1)
|
|
||||||
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
|
|
||||||
(setq projectile-completion-system 'ivy)
|
|
||||||
(setq projectile-switch-project-action 'projectile-dired))
|
|
||||||
|
|
||||||
;; Enable Which Key for keybindings help
|
|
||||||
(when (fboundp 'which-key-mode)
|
|
||||||
(which-key-mode 1)
|
|
||||||
(setq which-key-idle-delay 0.5)
|
|
||||||
(setq which-key-show-major-modes nil))
|
|
||||||
|
|
||||||
;; Configure Org Mode with Babel support for Nix and Shell
|
|
||||||
(require 'org)
|
|
||||||
(require 'ob-shell) ; Required for shell code blocks
|
|
||||||
(require 'ob-nix) ; Required for nix code blocks
|
|
||||||
(org-babel-do-load-languages
|
|
||||||
'org-babel-load-languages
|
|
||||||
'((emacs-lisp . t)
|
|
||||||
(nix . t)
|
|
||||||
(shell . t)
|
|
||||||
(python . t)
|
|
||||||
(dockerfile . t)))
|
|
||||||
(setq org-babel-tangle-lang-exts '(("nix" . "nix")))
|
|
||||||
(setq org-src-fontify-natively t)
|
|
||||||
(setq org-src-tab-act-as-tab t)
|
|
||||||
(setq org-edit-src-content-indentation 0)
|
|
||||||
(setq org-startup-indented t)
|
|
||||||
(setq org-startup-folded nil)
|
|
||||||
(setq org-ellipsis "⤵")
|
|
||||||
(setq org-hide-emphasis-markers t)
|
|
||||||
(setq org-image-actual-width nil)
|
|
||||||
(setq org-html-htmlize-output-type 'css)
|
|
||||||
(setq org-export-with-toc nil)
|
|
||||||
(setq org-todo-keywords '("TODO" "DOING" "|" "DONE" "CANCELED"))
|
|
||||||
(setq org-log-done 'time)
|
|
||||||
(setq org-directory "~/org")
|
|
||||||
(when (fboundp 'org-bullets-mode)
|
|
||||||
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
|
|
||||||
|
|
||||||
;; Enable Magit for Git
|
|
||||||
(when (fboundp 'magit-version)
|
|
||||||
(setq magit-display-buffer-function 'magit-display-buffer-fullscreen)
|
|
||||||
(setq magit-last-seen-setup-instruction "1.4.0"))
|
|
||||||
|
|
||||||
;; Enable LSP Mode for language server support
|
|
||||||
(when (fboundp 'lsp-mode)
|
|
||||||
(lsp-mode 1)
|
|
||||||
(setq lsp-keymap-prefix "C-c l")
|
|
||||||
(setq lsp-enable-snippets nil)
|
|
||||||
(setq lsp-enable-indentation nil)
|
|
||||||
(setq lsp-enable-on-type-formatting nil)
|
|
||||||
(setq lsp-lens-enable nil)
|
|
||||||
(setq lsp-signature-auto-activate nil))
|
|
||||||
|
|
||||||
;; Enable Dashboard
|
|
||||||
(when (fboundp 'dashboard-refresh-buffer)
|
|
||||||
(dashboard-mode 1)
|
|
||||||
(setq dashboard-items '((recents . 5)
|
|
||||||
(projects . 5)
|
|
||||||
(agenda . 5)
|
|
||||||
(bookmarks . 5)))
|
|
||||||
(setq dashboard-center-content t)
|
|
||||||
(setq dashboard-banner-logo-title "Droidnix Configuration"))
|
|
||||||
|
|
||||||
;; Enable Nix Mode
|
|
||||||
(when (fboundp 'nix-mode)
|
|
||||||
(setq auto-mode-alist (cons '("\\.nix\\'" . nix-mode) auto-mode-alist))
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-mode)))
|
|
||||||
|
|
||||||
;; Custom keybindings
|
|
||||||
(global-set-key (kbd "C-c t") 'treemacs)
|
|
||||||
(global-set-key (kbd "C-c p") 'projectile-command-map)
|
|
||||||
(global-set-key (kbd "C-c g") 'magit-status)
|
|
||||||
(global-set-key (kbd "C-c d") 'dashboard-refresh-buffer)
|
|
||||||
(global-set-key (kbd "C-c b") 'ivy-switch-buffer)
|
|
||||||
(global-set-key (kbd "C-c f") 'find-file)
|
|
||||||
(global-set-key (kbd "C-c s") 'save-buffer)
|
|
||||||
(global-set-key (kbd "C-c q") 'kill-buffer)
|
|
||||||
(global-set-key (kbd "C-c w") 'widen)
|
|
||||||
(global-set-key (kbd "C-c n") 'narrow-to-region)
|
|
||||||
|
|
||||||
;; Nix-specific configurations
|
|
||||||
(setq nix-indent-width 2)
|
|
||||||
(setq nix-continuation-indent-width 4)
|
|
||||||
|
|
||||||
;; HTML export settings for Org
|
|
||||||
(setq org-html-head-include-default-style nil)
|
|
||||||
(setq org-html-head-extra "
|
|
||||||
<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/tree.js@1.0.0/dist/tree.min.css\">
|
|
||||||
<script src=\"https://cdn.jsdelivr.net/npm/tree.js@1.0.0/dist/tree.min.js\"></script>
|
|
||||||
<style>
|
|
||||||
.tree { font-family: monospace; white-space: pre; }
|
|
||||||
#table-of-contents { display: none; }
|
|
||||||
.org-src-container { background-color: #313244; color: #cdd6f4; padding: 1em; border-radius: 5px; }
|
|
||||||
pre.src { background-color: #313244; padding: 1em; border-radius: 5px; }
|
|
||||||
</style>")
|
|
||||||
|
|
||||||
;; Function to wrap tree output in div for HTML export
|
|
||||||
(defun my/org-wrap-tree-in-div ()
|
|
||||||
"Wrap the Nix tree output in a div with class 'tree' for HTML export."
|
|
||||||
(interactive)
|
|
||||||
(save-excursion
|
|
||||||
(goto-char (point-min))
|
|
||||||
(when (re-search-forward "#+RESULTS:\n#+BEGIN_EXAMPLE\n\\(.*?\n\\)#+END_EXAMPLE" nil t)
|
|
||||||
(goto-char (match-beginning 1))
|
|
||||||
(insert "#+HTML: <div class=\"tree\">\n")
|
|
||||||
(goto-char (match-end 1))
|
|
||||||
(insert "#+HTML: </div>\n"))))
|
|
||||||
|
|
||||||
;; Add hook to automatically wrap tree output on export
|
|
||||||
(add-hook 'org-export-before-processing-hook 'my/org-wrap-tree-in-div)
|
|
||||||
|
|
||||||
;; Set default mode for new buffers
|
|
||||||
(setq-default major-mode 'text-mode)
|
|
||||||
(setq-default indent-tabs-mode nil)
|
|
||||||
(setq default-tab-width 2)
|
|
||||||
(setq tab-width 2)
|
|
||||||
|
|
||||||
;; Enable line numbers globally
|
|
||||||
(global-display-line-numbers-mode 1)
|
|
||||||
(setq display-line-numbers-type 'relative)
|
|
||||||
|
|
||||||
;; Configure fill column indicator
|
|
||||||
(setq display-fill-column-indicator t)
|
|
||||||
(setq display-fill-column-indicator-character ?│)
|
|
||||||
(setq fill-column 80)
|
|
||||||
|
|
||||||
;; Enable delete-selection-mode for more intuitive editing
|
|
||||||
(delete-selection-mode 1)
|
|
||||||
|
|
||||||
;; Configure modeline
|
|
||||||
(setq display-time-day-and-date t)
|
|
||||||
(setq display-time-24hr-format t)
|
|
||||||
|
|
||||||
;; Configure frame appearance
|
|
||||||
(setq default-frame-alist '((fullscreen . maximized)
|
|
||||||
(alpha . (95 95))
|
|
||||||
(vertical-scroll-bars . nil)
|
|
||||||
(tool-bar-lines . 0)
|
|
||||||
(menu-bar-lines . 0)
|
|
||||||
(line-spacing . 3)
|
|
||||||
(font . "Fira Code-12")))
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Clean up
|
|
||||||
rm "$TEMP_CONFIG"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "Emacs setup complete with Catppuccin Mocha and all plugins!"
|
|
||||||
echo ""
|
|
||||||
echo "Installed packages:"
|
|
||||||
echo " ✅ Catppuccin Mocha (theme)"
|
|
||||||
echo " ✅ Org mode + Org Bullets + Org Babel (Nix/Shell support)"
|
|
||||||
echo " ✅ Magit (Git interface)"
|
|
||||||
echo " ✅ Company (autocomplete)"
|
|
||||||
echo " ✅ Flycheck (syntax checking)"
|
|
||||||
echo " ✅ Doom Modeline (status bar)"
|
|
||||||
echo " ✅ Which Key (keybindings help)"
|
|
||||||
echo " ✅ Projectile (project management)"
|
|
||||||
echo " ✅ Ivy + Counsel (completion framework)"
|
|
||||||
echo " ✅ All The Icons (pretty icons)"
|
|
||||||
echo " ✅ Treemacs (file tree)"
|
|
||||||
echo " ✅ LSP Mode (language server)"
|
|
||||||
echo " ✅ ob-shell + ob-nix (Org Babel support)"
|
|
||||||
echo " ✅ Dashboard (start page)"
|
|
||||||
echo " ✅ tree.js (for collapsible directory trees in HTML export)"
|
|
||||||
echo ""
|
|
||||||
echo "You can now:"
|
|
||||||
echo "1. Tangle Org files: emacs README.org --batch -f org-babel-tangle"
|
|
||||||
echo "2. Export to HTML: emacs -Q --batch README.org -f org-html-export-to-html"
|
|
||||||
echo "3. Open Emacs: emacs"
|
|
||||||
echo ""
|
|
||||||
echo "The configuration includes:"
|
|
||||||
echo "- Proper Org Babel support for shell and Nix"
|
|
||||||
echo "- Tree.js integration for collapsible directory trees in HTML export"
|
|
||||||
echo "- Custom keybindings for common operations"
|
|
||||||
echo "- Enhanced UI with Treemacs, Doom Modeline, and Catppuccin theme"
|
|
||||||
echo "- Optimized settings for Nix development"
|
|
||||||
echo "- HTML export with embedded CSS for better styling"
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Install Neovim and Neovide using nix-env with the correct attribute path for NixOS
|
|
||||||
echo "Installing Neovim and Neovide..."
|
|
||||||
nix-env -iA nixos.neovim nixos.neovide
|
|
||||||
|
|
||||||
# Create Neovim config directory
|
|
||||||
NVIM_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/nvim"
|
|
||||||
mkdir -p "$NVIM_CONFIG_DIR"
|
|
||||||
|
|
||||||
# Install packer.nvim (plugin manager)
|
|
||||||
PACKER_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/nvim/site/pack/packer/start/packer.nvim"
|
|
||||||
if [ ! -d "$PACKER_DIR" ]; then
|
|
||||||
echo "Installing packer.nvim..."
|
|
||||||
git clone --depth 1 https://github.com/wbthomason/packer.nvim "$PACKER_DIR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Write minimal init.lua for literate NixOS
|
|
||||||
cat > "$NVIM_CONFIG_DIR/init.lua" << 'EOF'
|
|
||||||
-- Enable filetype detection, syntax highlighting, and indenting
|
|
||||||
vim.cmd([[
|
|
||||||
filetype plugin indent on
|
|
||||||
syntax on
|
|
||||||
]])
|
|
||||||
|
|
||||||
-- Leader key
|
|
||||||
vim.g.mapleader = " "
|
|
||||||
|
|
||||||
-- Install plugins with Packer
|
|
||||||
local fn = vim.fn
|
|
||||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
|
||||||
local packer_bootstrap = false
|
|
||||||
|
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
|
||||||
packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
|
||||||
vim.cmd [[packadd packer.nvim]]
|
|
||||||
end
|
|
||||||
|
|
||||||
require('packer').startup(function(use)
|
|
||||||
-- Plugin manager
|
|
||||||
use 'wbthomason/packer.nvim'
|
|
||||||
|
|
||||||
-- Catppuccin theme
|
|
||||||
use { 'catppuccin/nvim', as = 'catppuccin' }
|
|
||||||
|
|
||||||
-- Orgmode for literate NixOS
|
|
||||||
use {
|
|
||||||
'nvim-orgmode/orgmode',
|
|
||||||
config = function()
|
|
||||||
require('orgmode').setup({
|
|
||||||
org_agenda_files = {'~/Documents/org/*'},
|
|
||||||
org_default_notes_file = '~/Documents/org/notes.org',
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Treesitter (better syntax highlighting)
|
|
||||||
use {
|
|
||||||
'nvim-treesitter/nvim-treesitter',
|
|
||||||
run = ':TSUpdate',
|
|
||||||
config = function()
|
|
||||||
require('nvim-treesitter.configs').setup({
|
|
||||||
ensure_installed = {'nix', 'org'},
|
|
||||||
highlight = { enable = true },
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- LSP (for Nix language server)
|
|
||||||
use {
|
|
||||||
'neovim/nvim-lspconfig',
|
|
||||||
config = function()
|
|
||||||
require('lspconfig').nil_ls.setup({})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Telescope (fuzzy finder)
|
|
||||||
use {
|
|
||||||
'nvim-telescope/telescope.nvim',
|
|
||||||
requires = {{'nvim-lua/plenary.nvim'}}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Automatically set up after cloning packer.nvim
|
|
||||||
if packer_bootstrap then
|
|
||||||
require('packer').sync()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Set Catppuccin theme
|
|
||||||
vim.cmd.colorscheme('catppuccin-mocha')
|
|
||||||
|
|
||||||
-- Keybindings for orgmode
|
|
||||||
vim.api.nvim_set_keymap('n', '<leader>oo', '<cmd>lua require("orgmode").action("agenda.prompt")<cr>', { noremap = true, silent = true })
|
|
||||||
vim.api.nvim_set_keymap('n', '<leader>oc', '<cmd>lua require("orgmode").action("capture.prompt")<cr>', { noremap = true, silent = true })
|
|
||||||
vim.api.nvim_set_keymap('n', '<leader>ot', '<cmd>lua require("orgmode").action("tangle.current_file")<cr>', { noremap = true, silent = true })
|
|
||||||
vim.api.nvim_set_keymap('n', '<leader>oe', '<cmd>lua require("orgmode").action("export.current_file")<cr>', { noremap = true, silent = true })
|
|
||||||
|
|
||||||
-- Auto-install LSP and Treesitter parsers on first run
|
|
||||||
vim.api.nvim_create_autocmd('BufEnter', {
|
|
||||||
pattern = {'*.nix', '*.org'},
|
|
||||||
callback = function()
|
|
||||||
vim.cmd('TSInstall! nix')
|
|
||||||
vim.cmd('TSInstall! org')
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Install nil (Nix language server)
|
|
||||||
echo "Installing nil (Nix language server)..."
|
|
||||||
nix-env -iA nixos.nil
|
|
||||||
|
|
||||||
# Install Neovide config (optional)
|
|
||||||
NEOVIDE_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/neovide"
|
|
||||||
mkdir -p "$NEOVIDE_CONFIG_DIR"
|
|
||||||
cat > "$NEOVIDE_CONFIG_DIR/config.toml" << 'EOF'
|
|
||||||
[editor]
|
|
||||||
theme = "catppuccin-mocha"
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "Setup complete!"
|
|
||||||
echo "Run 'nvim' or 'neovide' to start."
|
|
||||||
echo "In Neovim, run ':PackerSync' to install plugins."
|
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
;;; package --- early init -*- lexical-binding: t -*-
|
||||||
|
;;; Commentary:
|
||||||
|
;;; Prevents white flash and better Emacs defaults
|
||||||
|
;;; Code:
|
||||||
|
(set-language-environment "UTF-8")
|
||||||
|
(setq-default
|
||||||
|
default-frame-alist
|
||||||
|
'((background-color . "#1e1e2e")
|
||||||
|
(bottom-divider-width . 1) ; Thin horizontal window divider
|
||||||
|
(foreground-color . "#bac2de") ; Default foreground color
|
||||||
|
(fullscreen . maximized) ; Maximize the window by default
|
||||||
|
(horizontal-scroll-bars . nil) ; No horizontal scroll-bars
|
||||||
|
(left-fringe . 8) ; Thin left fringe
|
||||||
|
(menu-bar-lines . 0) ; No menu bar
|
||||||
|
(right-divider-width . 1) ; Thin vertical window divider
|
||||||
|
(right-fringe . 8) ; Thin right fringe
|
||||||
|
(tool-bar-lines . 0) ; No tool bar
|
||||||
|
(undecorated . t) ; Remove extraneous X decorations
|
||||||
|
(vertical-scroll-bars . nil)) ; No vertical scroll-bars
|
||||||
|
user-full-name "Henrov henrov" ; ME!
|
||||||
|
;; memory configuration
|
||||||
|
;; Higher garbage collection threshold, prevents frequent gc locks, reset later
|
||||||
|
gc-cons-threshold most-positive-fixnum
|
||||||
|
;; Ignore warnings for (obsolete) elisp compilations
|
||||||
|
byte-compile-warnings '(not obsolete)
|
||||||
|
;; And other log types completely
|
||||||
|
warning-suppress-log-types '((comp) (bytecomp))
|
||||||
|
;; Large files are okay in the new millenium.
|
||||||
|
large-file-warning-threshold 100000000
|
||||||
|
;; dont show garbage collection messages at startup, will reset later
|
||||||
|
garbage-collection-messages nil
|
||||||
|
;; native compilation
|
||||||
|
package-native-compile t
|
||||||
|
native-comp-warning-on-missing-source nil
|
||||||
|
native-comp-async-report-warnings-errors 'silent
|
||||||
|
;; Read more based on system pipe capacity
|
||||||
|
read-process-output-max (max (* 10240 10240) read-process-output-max)
|
||||||
|
;; scroll configuration
|
||||||
|
scroll-margin 0 ; Lets scroll to the end of the margin
|
||||||
|
scroll-conservatively 100000 ; Never recenter the window
|
||||||
|
scroll-preserve-screen-position 1 ; Scrolling back and forth
|
||||||
|
;; frame config
|
||||||
|
;; Improve emacs startup time by not resizing to adjust for custom settings
|
||||||
|
frame-inhibit-implied-resize t
|
||||||
|
;; Dont resize based on character height / width but to exact pixels
|
||||||
|
frame-resize-pixelwise t
|
||||||
|
;; backups & files
|
||||||
|
backup-directory-alist '(("." . "~/.backups/")) ; Don't clutter
|
||||||
|
backup-by-copying t ; Don't clobber symlinks
|
||||||
|
create-lockfiles nil ; Don't have temp files
|
||||||
|
delete-old-versions t ; Cleanup automatically
|
||||||
|
kept-new-versions 6 ; Update every few times
|
||||||
|
kept-old-versions 2 ; And cleanup even more
|
||||||
|
version-control t ; Version them backups
|
||||||
|
delete-by-moving-to-trash t ; Dont delete, send to trash instead
|
||||||
|
;; startup
|
||||||
|
inhibit-startup-screen t ; I have already done the tutorial. Twice
|
||||||
|
inhibit-startup-message t ; I know I am ready
|
||||||
|
inhibit-startup-echo-area-message t ; Yep, still know it
|
||||||
|
initial-scratch-message nil ; I know it is the scratch buffer!
|
||||||
|
initial-buffer-choice nil
|
||||||
|
inhibit-startup-buffer-menu t
|
||||||
|
inhibit-x-resources t
|
||||||
|
initial-major-mode 'fundamental-mode
|
||||||
|
pgtk-wait-for-event-timeout 0.001 ; faster child frames
|
||||||
|
ad-redefinition-action 'accept ; dont care about legacy things being redefined
|
||||||
|
inhibit-compacting-font-caches t
|
||||||
|
;; tabs
|
||||||
|
tab-width 4 ; Always tab 4 spaces.
|
||||||
|
indent-tabs-mode nil ; Never use actual tabs.
|
||||||
|
;; rendering
|
||||||
|
cursor-in-non-selected-windows nil ; dont render cursors other windows
|
||||||
|
;; packages
|
||||||
|
use-package-always-defer t
|
||||||
|
load-prefer-newer t
|
||||||
|
default-input-method nil
|
||||||
|
use-dialog-box nil
|
||||||
|
use-file-dialog nil
|
||||||
|
use-package-expand-minimally t
|
||||||
|
package-enable-at-startup nil
|
||||||
|
use-package-enable-imenu-support t
|
||||||
|
auto-mode-case-fold nil ; No second pass of case-insensitive search over auto-mode-alist.
|
||||||
|
package-archives '(("melpa" . "https://melpa.org/packages/")
|
||||||
|
("gnu" . "https://elpa.gnu.org/packages/")
|
||||||
|
("nongnu" . "https://elpa.nongnu.org/nongnu/")
|
||||||
|
("melpa-stable" . "https://stable.melpa.org/packages/"))
|
||||||
|
package-archive-priorities '(("gnu" . 99)
|
||||||
|
("nongnu" . 80)
|
||||||
|
("melpa" . 70)
|
||||||
|
("melpa-stable" . 50))
|
||||||
|
)
|
||||||
|
;;; early-init.el ends here
|
||||||
@@ -0,0 +1,400 @@
|
|||||||
|
;;; package --- Summary - My minimal Emacs init file -*- lexical-binding: t -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
;;; Simple Emacs setup I carry everywhere
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
(setq custom-file (locate-user-emacs-file "custom.el"))
|
||||||
|
(load custom-file 'noerror) ;; no error on missing custom file
|
||||||
|
|
||||||
|
(require 'package)
|
||||||
|
(package-initialize)
|
||||||
|
|
||||||
|
(defun reset-custom-vars ()
|
||||||
|
"Resets the custom variables that were set to crazy numbers"
|
||||||
|
(setopt gc-cons-threshold (* 1024 1024 100))
|
||||||
|
(setopt garbage-collection-messages t))
|
||||||
|
|
||||||
|
(use-package emacs
|
||||||
|
:custom
|
||||||
|
(native-comp-async-query-on-exit t)
|
||||||
|
(read-answer-short t)
|
||||||
|
(use-short-answers t)
|
||||||
|
(enable-recursive-minibuffers t)
|
||||||
|
(which-func-update-delay 1.0)
|
||||||
|
(visible-bell nil)
|
||||||
|
(custom-buffer-done-kill t)
|
||||||
|
(whitespace-line-column nil)
|
||||||
|
(x-underline-at-descent-line t)
|
||||||
|
(imenu-auto-rescan t)
|
||||||
|
(uniquify-buffer-name-style 'forward)
|
||||||
|
(confirm-nonexistent-file-or-buffer nil)
|
||||||
|
(create-lockfiles nil)
|
||||||
|
(make-backup-files nil)
|
||||||
|
(kill-do-not-save-duplicates t)
|
||||||
|
(sentence-end-double-space nil)
|
||||||
|
(treesit-enabled-modes t)
|
||||||
|
:init
|
||||||
|
;; base visual
|
||||||
|
(menu-bar-mode -1) ;; no menu bar
|
||||||
|
(toggle-scroll-bar -1) ;; no scroll bar
|
||||||
|
(tool-bar-mode -1) ;; no tool bar either
|
||||||
|
(blink-cursor-mode -1) ;; stop blinking
|
||||||
|
|
||||||
|
;; font of the century
|
||||||
|
(set-frame-font "Aporetic Sans Mono 12" nil t)
|
||||||
|
|
||||||
|
:bind
|
||||||
|
(("C-<wheel-up>" . pixel-scroll-precision) ; dont zoom in please, just scroll
|
||||||
|
("C-<wheel-down>" . pixel-scroll-precision) ; dont zoom in either, just scroll
|
||||||
|
("C-x k" . kill-current-buffer)) ; kill the buffer, dont ask
|
||||||
|
:hook
|
||||||
|
(text-mode . delete-trailing-whitespace-mode)
|
||||||
|
(prog-mode . delete-trailing-whitespace-mode)
|
||||||
|
(after-init . global-display-line-numbers-mode) ;; always show line numbers
|
||||||
|
(after-init . column-number-mode) ;; column number in the mode line
|
||||||
|
(after-init . size-indication-mode) ;; file size in the mode line
|
||||||
|
(after-init . pixel-scroll-precision-mode) ;; smooth mouse scroll
|
||||||
|
(after-init . electric-pair-mode) ;; i mean ... parens should auto create
|
||||||
|
(after-init . reset-custom-vars)
|
||||||
|
)
|
||||||
|
|
||||||
|
(use-package autorevert
|
||||||
|
:ensure nil
|
||||||
|
:custom
|
||||||
|
(auto-revert-interval 3)
|
||||||
|
(auto-revert-remote-files nil)
|
||||||
|
(auto-revert-use-notify t)
|
||||||
|
(auto-revert-avoid-polling nil)
|
||||||
|
(auto-revert-verbose t)
|
||||||
|
:hook
|
||||||
|
(after-init . global-auto-revert-mode))
|
||||||
|
|
||||||
|
(use-package recentf
|
||||||
|
:ensure nil
|
||||||
|
:commands (recentf-mode recentf-cleanup)
|
||||||
|
:hook
|
||||||
|
(after-init . recentf-mode)
|
||||||
|
:custom
|
||||||
|
(recentf-auto-cleanup 'never)
|
||||||
|
(recentf-exclude
|
||||||
|
(list "\\.tar$" "\\.tbz2$" "\\.tbz$" "\\.tgz$" "\\.bz2$"
|
||||||
|
"\\.bz$" "\\.gz$" "\\.gzip$" "\\.xz$" "\\.zip$"
|
||||||
|
"\\.7z$" "\\.rar$"
|
||||||
|
"COMMIT_EDITMSG\\'"
|
||||||
|
"\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\|bmp\\|xpm\\)$"
|
||||||
|
"-autoloads\\.el$" "autoload\\.el$"))
|
||||||
|
|
||||||
|
:config
|
||||||
|
;; A cleanup depth of -90 ensures that `recentf-cleanup' runs before
|
||||||
|
;; `recentf-save-list', allowing stale entries to be removed before the list
|
||||||
|
;; is saved by `recentf-save-list', which is automatically added to
|
||||||
|
;; `kill-emacs-hook' by `recentf-mode'.
|
||||||
|
(add-hook 'kill-emacs-hook #'recentf-cleanup -90))
|
||||||
|
|
||||||
|
(use-package savehist
|
||||||
|
:ensure nil
|
||||||
|
:commands (savehist-mode savehist-save)
|
||||||
|
:hook
|
||||||
|
(after-init . savehist-mode)
|
||||||
|
:custom
|
||||||
|
(savehist-autosave-interval 600)
|
||||||
|
(savehist-additional-variables
|
||||||
|
'(kill-ring ; clipboard
|
||||||
|
register-alist ; macros
|
||||||
|
mark-ring global-mark-ring ; marks
|
||||||
|
search-ring regexp-search-ring)))
|
||||||
|
|
||||||
|
(use-package hl-line
|
||||||
|
:ensure nil
|
||||||
|
:custom
|
||||||
|
(hl-line-sticky-flag nil)
|
||||||
|
(global-hl-line-sticky-flag nil)
|
||||||
|
:hook
|
||||||
|
(after-init . global-hl-line-mode))
|
||||||
|
|
||||||
|
(use-package saveplace
|
||||||
|
:ensure nil
|
||||||
|
:commands (save-place-mode save-place-local-mode)
|
||||||
|
:hook
|
||||||
|
(after-init . save-place-mode)
|
||||||
|
:custom
|
||||||
|
(save-place-limit 400))
|
||||||
|
|
||||||
|
(use-package nerd-icons
|
||||||
|
:custom
|
||||||
|
;; disable bright icon colors
|
||||||
|
(nerd-icons-color-icons nil))hells.nix
|
||||||
|
|
||||||
|
(use-package doom-modeline
|
||||||
|
:custom
|
||||||
|
(inhibit-compacting-font-caches t) ;; speed
|
||||||
|
(doom-modeline-buffer-file-name-style 'relative-from-project)
|
||||||
|
(doom-modeline-major-mode-icon nil) ;; distracting icons, no thank you
|
||||||
|
(doom-modeline-buffer-encoding nil) ;; everything is utf-8 anyway
|
||||||
|
(doom-modeline-buffer-state-icon nil) ;; the filename already shows me
|
||||||
|
(doom-modeline-lsp nil) ;; lsp state is too distracting, too often
|
||||||
|
:hook (after-init . doom-modeline-mode))
|
||||||
|
|
||||||
|
(load-theme 'catppuccin :no-confirm)
|
||||||
|
|
||||||
|
(use-package diminish :demand t) ;; declutter the modeline
|
||||||
|
(use-package eldoc
|
||||||
|
:diminish eldoc-mode
|
||||||
|
:custom
|
||||||
|
(eldoc-echo-area-use-multiline-p nil)) ;; docs for everything
|
||||||
|
|
||||||
|
(use-package eldoc-box
|
||||||
|
:defer t
|
||||||
|
:config
|
||||||
|
(set-face-background 'eldoc-box-border (catppuccin-color 'green))
|
||||||
|
(set-face-background 'eldoc-box-body (catppuccin-color 'base))
|
||||||
|
:bind
|
||||||
|
(("M-h" . eldoc-box-help-at-point)))
|
||||||
|
|
||||||
|
(use-package pulsar
|
||||||
|
:commands pulsar-global-mode pulsar-recenter-top pulsar-reveal-entry
|
||||||
|
:init
|
||||||
|
(defface pulsar-catppuccin
|
||||||
|
`((default :extend t)
|
||||||
|
(((class color) (min-colors 88) (background light))
|
||||||
|
:background ,(catppuccin-color 'sapphire))
|
||||||
|
(((class color) (min-colors 88) (background dark))
|
||||||
|
:background ,(catppuccin-color 'sapphire))
|
||||||
|
(t :inverse-video t))
|
||||||
|
"Alternative nord face for `pulsar-face'."
|
||||||
|
:group 'pulsar-faces)
|
||||||
|
:custom
|
||||||
|
(pulsar-face 'pulsar-catppuccin)
|
||||||
|
:hook
|
||||||
|
(after-init . pulsar-global-mode))
|
||||||
|
|
||||||
|
(use-package which-key
|
||||||
|
:commands which-key-mode
|
||||||
|
:diminish which-key-mode
|
||||||
|
:hook
|
||||||
|
(after-init . which-key-mode))
|
||||||
|
|
||||||
|
(use-package expreg
|
||||||
|
:bind ("M-m" . expreg-expand))
|
||||||
|
|
||||||
|
(use-package vundo) ;; undo tree
|
||||||
|
|
||||||
|
;; better structured editing
|
||||||
|
(use-package puni
|
||||||
|
:commands puni-global-mode
|
||||||
|
:hook
|
||||||
|
(after-init . puni-global-mode))
|
||||||
|
|
||||||
|
(use-package avy
|
||||||
|
:bind
|
||||||
|
("M-i" . avy-goto-char-2)
|
||||||
|
:custom
|
||||||
|
(avy-background t))
|
||||||
|
|
||||||
|
(use-package consult
|
||||||
|
:bind
|
||||||
|
("C-x b" . consult-buffer) ;; orig. switch-to-buffer
|
||||||
|
("M-y" . consult-yank-pop) ;; orig. yank-pop
|
||||||
|
("M-g M-g" . consult-goto-line) ;; orig. goto-line
|
||||||
|
("M-g i" . consult-imenu) ;; consult version is interactive
|
||||||
|
("M-g r" . consult-ripgrep) ;; find in project also works
|
||||||
|
:custom
|
||||||
|
(consult-narrow-key "<"))
|
||||||
|
|
||||||
|
(use-package vertico
|
||||||
|
:commands vertico-mode
|
||||||
|
:custom
|
||||||
|
(read-file-name-completion-ignore-case t)
|
||||||
|
(read-buffer-completion-ignore-case t)
|
||||||
|
(completion-ignore-case t)
|
||||||
|
(enable-recursive-minibuffers t)
|
||||||
|
(minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt))
|
||||||
|
:init
|
||||||
|
(vertico-mode)
|
||||||
|
:hook
|
||||||
|
(minibuffer-setup-hook . cursor-intangible-mode))
|
||||||
|
|
||||||
|
(use-package marginalia
|
||||||
|
:commands marginalia-mode
|
||||||
|
:hook (after-init . marginalia-mode))
|
||||||
|
|
||||||
|
(use-package crux
|
||||||
|
:bind
|
||||||
|
("C-c M-e" . crux-find-user-init-file)
|
||||||
|
("C-c C-w" . crux-transpose-windows)
|
||||||
|
("C-c M-d" . crux-find-current-directory-dir-locals-file)
|
||||||
|
("C-a" . crux-move-beginning-of-line))
|
||||||
|
|
||||||
|
(use-package magit
|
||||||
|
:bind (("C-M-g" . magit-status)))
|
||||||
|
|
||||||
|
(use-package nerd-icons-corfu
|
||||||
|
:commands nerd-icons-corfu-formatter
|
||||||
|
:defines corfu-margin-formatters)
|
||||||
|
|
||||||
|
(use-package corfu
|
||||||
|
:commands global-corfu-mode
|
||||||
|
:custom
|
||||||
|
(corfu-cycle t)
|
||||||
|
(corfu-auto t)
|
||||||
|
(corfu-auto-delay 1)
|
||||||
|
(corfu-auto-prefix 3)
|
||||||
|
(corfu-separator ?_)
|
||||||
|
:hook
|
||||||
|
(after-init . global-corfu-mode)
|
||||||
|
:config
|
||||||
|
(add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
|
||||||
|
|
||||||
|
(use-package cape)
|
||||||
|
|
||||||
|
(use-package orderless
|
||||||
|
:custom
|
||||||
|
(completion-styles '(orderless partial-completion basic))
|
||||||
|
(completion-category-defaults nil)
|
||||||
|
(completion-category-overrides nil))
|
||||||
|
|
||||||
|
(use-package yasnippet
|
||||||
|
:commands yas-global-mode
|
||||||
|
:diminish yas-minor-mode
|
||||||
|
:hook
|
||||||
|
(after-init . yas-global-mode))
|
||||||
|
|
||||||
|
(use-package yasnippet-snippets :after yasnippet)
|
||||||
|
|
||||||
|
(use-package exec-path-from-shell
|
||||||
|
:commands exec-path-from-shell-initialize
|
||||||
|
:custom
|
||||||
|
(exec-path-from-shell-arguments nil)
|
||||||
|
:hook
|
||||||
|
(after-init . exec-path-from-shell-initialize))
|
||||||
|
|
||||||
|
(use-package nixpkgs-fmt
|
||||||
|
:custom
|
||||||
|
(nixpkgs-fmt-command "nixfmt"))
|
||||||
|
|
||||||
|
(use-package eat
|
||||||
|
:bind
|
||||||
|
(("C-c e p" . eat-project)
|
||||||
|
("C-c e t" . eat)))
|
||||||
|
|
||||||
|
(use-package f :demand t)
|
||||||
|
|
||||||
|
(use-package envrc
|
||||||
|
:commands envrc-global-mode
|
||||||
|
:hook
|
||||||
|
(after-init . envrc-global-mode))
|
||||||
|
|
||||||
|
(use-package gptel
|
||||||
|
:commands gptel-make-anthropic f-read-text
|
||||||
|
:config
|
||||||
|
(gptel-make-anthropic "Claude"
|
||||||
|
:stream t :key (f-read-text "/run/secrets/claude_key")))
|
||||||
|
|
||||||
|
(use-package sideline-flymake)
|
||||||
|
(use-package sideline-eglot)
|
||||||
|
(use-package sideline
|
||||||
|
:custom
|
||||||
|
(sideline-backends-right '(sideline-flymake sideline-eglot))
|
||||||
|
:hook
|
||||||
|
(eglot-managed-mode . sideline-mode)
|
||||||
|
(flymake-mode . sideline-mode))
|
||||||
|
|
||||||
|
(use-package eglot
|
||||||
|
:custom
|
||||||
|
(eglot-extend-to-xref t)
|
||||||
|
(eglot-ignored-server-capabilities '(:inlayHintProvider))
|
||||||
|
(jsonrpc-event-hook nil)
|
||||||
|
:hook
|
||||||
|
(eglot-managed-mode . eldoc-box-hover-mode)
|
||||||
|
(before-save . eldoc-format-buffer)
|
||||||
|
:bind
|
||||||
|
(:map eglot-mode-map
|
||||||
|
("C-c l a" . eglot-code-actions)
|
||||||
|
("C-c l r" . eglot-rename)
|
||||||
|
("C-c l h" . eldoc)
|
||||||
|
("C-c l g" . xref-find-references)
|
||||||
|
("C-c l w" . eglot-reconnect)))
|
||||||
|
|
||||||
|
(use-package proced
|
||||||
|
:custom
|
||||||
|
(proced-auto-update-flag t)
|
||||||
|
(proced-auto-update-interval 3)
|
||||||
|
(proced-enable-color-flag t)
|
||||||
|
(proced-show-remote-processes t))
|
||||||
|
|
||||||
|
(use-package org
|
||||||
|
:ensure t
|
||||||
|
:defer t
|
||||||
|
:commands (org-mode org-capture org-agenda)
|
||||||
|
:init
|
||||||
|
(defvar org-journal-file "~/nextcloud/org/journal.org")
|
||||||
|
(defvar org-archive-file "~/nextcloud/org/archive.org")
|
||||||
|
(defvar org-notes-file "~/nextcloud/org/notes.org")
|
||||||
|
(defvar org-inbox-file "~/nextcloud/org/inbox.org")
|
||||||
|
(defvar org-work-file "~/nextcloud/org/work.org")
|
||||||
|
(defun my/org-capture-project-target-heading ()
|
||||||
|
"Determine Org target headings from the current file's project path.
|
||||||
|
|
||||||
|
This function assumes a directory structure like '~/projects/COMPANY/PROJECT/'.
|
||||||
|
It extracts 'COMPANY' and 'PROJECT' to use as nested headlines
|
||||||
|
for an Org capture template.
|
||||||
|
|
||||||
|
If the current buffer is not visi
|
||||||
|
ting a file within such a
|
||||||
|
project structure, it returns nil, causing capture to default to
|
||||||
|
the top of the file."
|
||||||
|
(when-let* ((path (buffer-file-name))) ; Ensure we are in a file-visiting buffer
|
||||||
|
(let ((path-parts (split-string path "/" t " ")))
|
||||||
|
(when-let* ((projects-pos (cl-position "projects" path-parts :test #'string=))
|
||||||
|
(company (nth (+ 1 projects-pos) path-parts))
|
||||||
|
(project (nth (+ 2 projects-pos) path-parts)))
|
||||||
|
;; Return a list of headlines for Org to find or create.
|
||||||
|
(list company project)))))
|
||||||
|
:bind
|
||||||
|
(("C-c c" . org-capture)
|
||||||
|
("C-c i" . org-store-link)
|
||||||
|
("C-c a" . org-agenda)
|
||||||
|
:map org-mode-map
|
||||||
|
("C-c t" . org-toggle-inline-images)
|
||||||
|
("C-c l" . org-toggle-link-display))
|
||||||
|
:custom
|
||||||
|
(org-agenda-files (list org-inbox-file org-journal-file))
|
||||||
|
(org-directory "~/nextcloud/org")
|
||||||
|
(org-default-notes-file org-inbox-file)
|
||||||
|
(org-archive-location (concat org-archive-file "::* From %s"))
|
||||||
|
(org-log-done 'time)
|
||||||
|
(org-log-into-drawer t)
|
||||||
|
(org-hide-emphasis-markers t)
|
||||||
|
(org-src-fontify-natively t)
|
||||||
|
(org-src-tab-acts-natively t)
|
||||||
|
(org-capture-templates '(("t" "Todo" entry (file org-inbox-file)
|
||||||
|
"* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n%a\n\n)")
|
||||||
|
("j" "Journal" entry (file+olp+datetree org-journal-file)
|
||||||
|
"* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n%a\n\n")
|
||||||
|
("n" "Note" entry (file org-notes-file)
|
||||||
|
"* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n%a\n\n")
|
||||||
|
("p" "Project Task" item
|
||||||
|
(file+function org-work-file my/org-capture-project-target-heading)
|
||||||
|
"* TODO %? \n CLOCK: %U"
|
||||||
|
))
|
||||||
|
)
|
||||||
|
:config
|
||||||
|
;; Enable syntax highlighting in code blocks
|
||||||
|
(add-hook 'org-mode-hook 'turn-on-font-lock)
|
||||||
|
(add-hook 'org-mode-hook 'org-indent-mode))
|
||||||
|
|
||||||
|
;; extras
|
||||||
|
(use-package comp-run
|
||||||
|
:ensure nil
|
||||||
|
:config
|
||||||
|
(push "tramp-loaddefs.el.gz" native-comp-jit-compilation-deny-list)
|
||||||
|
(push "cl-loaddefs.el.gz" native-comp-jit-compilation-deny-list))
|
||||||
|
|
||||||
|
(use-package rustic
|
||||||
|
:custom
|
||||||
|
(rustic-lsp-client 'eglot))
|
||||||
|
|
||||||
|
(provide 'init)
|
||||||
|
|
||||||
|
;;; init.el ends here
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
{ config, pkgs, lib, flakeRoot, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
boot.loader = {
|
|
||||||
systemd-boot.enable = true;
|
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
efi.efiSysMountPoint = "/boot";
|
|
||||||
timeout = 5;
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
|
|
||||||
boot.kernelParams = [
|
|
||||||
"quiet"
|
|
||||||
"splash"
|
|
||||||
"udev.log_level=3"
|
|
||||||
"rd.systemd.show_status=false"
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.consoleLogLevel = 0;
|
|
||||||
#boot.initrd.systemd.enable = true;
|
|
||||||
boot.initrd.availableKernelModules = [
|
|
||||||
"xhci_pci"
|
|
||||||
"nvme"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
"rtsx_usb_sdmmc"
|
|
||||||
];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
|
|
||||||
boot.plymouth = {
|
|
||||||
enable = true;
|
|
||||||
theme = "rings";
|
|
||||||
themePackages = [
|
|
||||||
(pkgs.adi1090x-plymouth-themes.override {
|
|
||||||
selected_themes = [ "rings" ];
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
hostname,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
user,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
# (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
#../../hardware/hardware.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [
|
|
||||||
"xhci_pci"
|
|
||||||
"nvme"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
"rtsx_usb_sdmmc"
|
|
||||||
];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
fileSystems."/" = {
|
|
||||||
device = "/dev/disk/by-uuid/69433a14-fbaf-401b-af85-cd1bbf02b4e2";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
|
||||||
device = "/dev/disk/by-uuid/811D-0676";
|
|
||||||
fsType = "vfat";
|
|
||||||
options = [
|
|
||||||
"fmask=0077"
|
|
||||||
"dmask=0077"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [
|
|
||||||
{ device = "/dev/disk/by-uuid/b6c557c2-7682-460b-a5e7-8f6f2f429a3a"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
{ lib, config, pkgs, flakeRoot, import-tree, home-manager, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
hostname = "traveldroid";
|
|
||||||
|
|
||||||
modulesPath = "${flakeRoot}/generated/modules/${hostname}";
|
|
||||||
usersPath = "${flakeRoot}/generated/users";
|
|
||||||
|
|
||||||
hostModules = import-tree modulesPath;
|
|
||||||
globalUsers = import-tree usersPath;
|
|
||||||
|
|
||||||
allModules = hostModules.imports ++ globalUsers.imports;
|
|
||||||
|
|
||||||
in
|
|
||||||
{
|
|
||||||
#################################
|
|
||||||
# Core system config
|
|
||||||
#################################
|
|
||||||
|
|
||||||
networking.hostName = hostname;
|
|
||||||
system.stateVersion = "26.05";
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Imports
|
|
||||||
#################################
|
|
||||||
|
|
||||||
imports =
|
|
||||||
[
|
|
||||||
./boot.nix
|
|
||||||
./hardware-configuration.nix
|
|
||||||
|
|
||||||
# REQUIRED for Home Manager
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
]
|
|
||||||
++ allModules;
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Home Manager integration
|
|
||||||
#################################
|
|
||||||
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
|
|
||||||
# Install dconf for the system/user
|
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.dconf
|
|
||||||
];
|
|
||||||
|
|
||||||
# Ensure Home Manager writes dconf safely
|
|
||||||
programs.dconf.enable = true;
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
{ lib, pkgs, config, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
#################################
|
|
||||||
# Determine default username
|
|
||||||
#################################
|
|
||||||
username = config.defaultUser or "henrov";
|
|
||||||
moduleName = "kitty";
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Paths to assets
|
|
||||||
#################################
|
|
||||||
assetPath = ../../../assets/traveldroid/conf/${moduleName};
|
|
||||||
programFiles = builtins.readDir assetPath;
|
|
||||||
|
|
||||||
# Convert asset files into a nix attribute set
|
|
||||||
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
|
|
||||||
source = "${assetPath}/${name}";
|
|
||||||
});
|
|
||||||
|
|
||||||
in
|
|
||||||
{
|
|
||||||
#################################
|
|
||||||
# System-wide packages
|
|
||||||
#################################
|
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.kitty
|
|
||||||
];
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Home Manager user configuration
|
|
||||||
#################################
|
|
||||||
_module.args.hmUsers = {
|
|
||||||
${username} = {
|
|
||||||
|
|
||||||
# Enable Kitty through Home Manager
|
|
||||||
programs.kitty.enable = true;
|
|
||||||
|
|
||||||
# Extra user-specific config snippet
|
|
||||||
programs.kitty.extraConfig = ''
|
|
||||||
# Include the Catppuccin-Mocha theme
|
|
||||||
include themes/Catppuccin-Mocha.conf
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Map all asset files into ~/.config/kitty/
|
|
||||||
home.file = lib.mkMerge (
|
|
||||||
map (name: { ".config/${moduleName}/${name}" = { source = files.${name}.source; }; })
|
|
||||||
(builtins.attrNames files)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
{ lib, config, pkgs, flakeRoot, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
#################################
|
|
||||||
# Read package list from config file
|
|
||||||
#################################
|
|
||||||
packagesConfPath = "${flakeRoot}/assets/traveldroid/conf/packages.conf";
|
|
||||||
raw = builtins.readFile packagesConfPath;
|
|
||||||
|
|
||||||
rawLines = lib.splitString "\n" raw;
|
|
||||||
|
|
||||||
# Guard against splitting into characters accidentally
|
|
||||||
_guard = assert !(builtins.stringLength raw > 1 && builtins.length rawLines == builtins.stringLength raw); true;
|
|
||||||
|
|
||||||
# Clean each line: remove CRs, comments, trim whitespace
|
|
||||||
cleanLine = line:
|
|
||||||
let
|
|
||||||
noCR = lib.replaceStrings [ "\r" ] [ "" ] line;
|
|
||||||
noInlineComment = lib.head (lib.splitString "#" noCR);
|
|
||||||
in
|
|
||||||
lib.strings.trim noInlineComment;
|
|
||||||
|
|
||||||
# Filter out empty lines
|
|
||||||
entries = builtins.filter (l: l != "") (map cleanLine rawLines);
|
|
||||||
|
|
||||||
# Resolve attribute paths in pkgs
|
|
||||||
resolvePkg = name:
|
|
||||||
let
|
|
||||||
parts = lib.splitString "." name;
|
|
||||||
found = lib.attrByPath parts null pkgs;
|
|
||||||
in
|
|
||||||
if found == null then
|
|
||||||
(throw ''
|
|
||||||
packages.nix: package not found in pkgs
|
|
||||||
Token : ${builtins.toJSON name}
|
|
||||||
packages.conf : ${packagesConfPath}
|
|
||||||
Hint : check the attribute name on search.nixos.org/packages
|
|
||||||
'')
|
|
||||||
else
|
|
||||||
found;
|
|
||||||
|
|
||||||
# Final system-wide package list
|
|
||||||
packages = builtins.seq _guard (map resolvePkg entries);
|
|
||||||
|
|
||||||
in {
|
|
||||||
#################################
|
|
||||||
# Allow unfree packages globally
|
|
||||||
#################################
|
|
||||||
nixpkgs.config = { allowUnfree = true; };
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# System packages
|
|
||||||
#################################
|
|
||||||
environment.systemPackages = packages;
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{ lib, config, pkgs, flakeRoot, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
# Default username fallback
|
|
||||||
username = config.defaultUser or "henrov";
|
|
||||||
|
|
||||||
# Path to the starship config in assets
|
|
||||||
starshipConfSrc = "${flakeRoot}/assets/traveldroid/conf/starship.toml";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
#################################
|
|
||||||
# Enable Starship system-wide
|
|
||||||
#################################
|
|
||||||
environment.systemPackages = [ pkgs.starship ];
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Home Manager user configuration
|
|
||||||
#################################
|
|
||||||
_module.args.hmUsers = {
|
|
||||||
${username} = {
|
|
||||||
programs.starship = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Copy the starship.toml from assets to ~/.config/starship.toml
|
|
||||||
home.file = {
|
|
||||||
".config/starship.toml" = { source = starshipConfSrc; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
# Resolve the default username from host config
|
|
||||||
username = config.defaultUser or "henrov";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
############################
|
|
||||||
# System-level packages
|
|
||||||
############################
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
thunar # main file manager
|
|
||||||
thunar-archive-plugin # zip, tar, rar, 7z support
|
|
||||||
thunar-volman # auto-mount removable drives
|
|
||||||
gvfs # support for external drives and network shares
|
|
||||||
xarchiver # optional GUI archive manager
|
|
||||||
];
|
|
||||||
|
|
||||||
############################
|
|
||||||
# Home Manager user-level configuration
|
|
||||||
############################
|
|
||||||
# Direct assignment to the user avoids recursiveUpdate issues
|
|
||||||
home-manager.users."${username}" = {
|
|
||||||
home.stateVersion = "26.05"; # required
|
|
||||||
|
|
||||||
home.sessionVariables = {
|
|
||||||
FILE_MANAGER = "thunar";
|
|
||||||
USERNAME = username;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{ config, pkgs, lib, zen-browser, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
# Grab the Zen Browser package for this host system
|
|
||||||
zenBrowser = zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
environment.systemPackages = [
|
|
||||||
zenBrowser
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
{
|
|
||||||
programs.zsh = {
|
|
||||||
enable = true;
|
|
||||||
enableCompletion = true;
|
|
||||||
# autocd = true;
|
|
||||||
# dotDir = "${config.xdg.configHome}/zsh";
|
|
||||||
ohMyZsh = {
|
|
||||||
enable = true;
|
|
||||||
theme = "";
|
|
||||||
plugins = [
|
|
||||||
"git"
|
|
||||||
"sudo"
|
|
||||||
"extract"
|
|
||||||
"colored-man-pages"
|
|
||||||
"command-not-found"
|
|
||||||
"history"
|
|
||||||
"docker"
|
|
||||||
"kubectl"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
autosuggestions.enable = true;
|
|
||||||
syntaxHighlighting.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{ lib, pkgs, config, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
fonts.packages = with pkgs; [
|
|
||||||
nerd-fonts.iosevka
|
|
||||||
nerd-fonts.fira-code
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
# Resolve the username from the host config
|
|
||||||
username = config.defaultUser or "henrov";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
############################
|
|
||||||
# System-level GTK packages
|
|
||||||
############################
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
gtk3
|
|
||||||
gtk4
|
|
||||||
];
|
|
||||||
|
|
||||||
############################
|
|
||||||
# Home Manager user-level GTK configuration
|
|
||||||
############################
|
|
||||||
# Directly assign the GTK config to the user, no recursiveUpdate
|
|
||||||
home-manager.users."${username}" = {
|
|
||||||
gtk = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# GTK theme
|
|
||||||
theme = {
|
|
||||||
name = "Catppuccin-Mocha-Standard-Blue-Dark";
|
|
||||||
package = pkgs.magnetic-catppuccin-gtk;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Icon theme
|
|
||||||
iconTheme = {
|
|
||||||
name = "Papirus-Dark";
|
|
||||||
package = pkgs.papirus-icon-theme;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Extra GTK3 / GTK4 settings
|
|
||||||
gtk3.extraConfig = {
|
|
||||||
"gtk-application-prefer-dark-theme" = 1;
|
|
||||||
};
|
|
||||||
gtk4.extraConfig = {
|
|
||||||
"gtk-application-prefer-dark-theme" = 1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
{ lib, config, pkgs, flakeRoot, home-manager, inputs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
username = config.defaultUser or "henrov";
|
|
||||||
assetPath = "${flakeRoot}/assets/traveldroid/conf/hypr/";
|
|
||||||
|
|
||||||
# Read all files in the asset directory
|
|
||||||
assetFiles = builtins.attrNames (builtins.readDir assetPath);
|
|
||||||
|
|
||||||
# Convert files to Home Manager xdg config entries
|
|
||||||
hyprFiles = lib.genAttrs assetFiles (f: {
|
|
||||||
# Destination path in home directory
|
|
||||||
name = ".config/hypr/${f}";
|
|
||||||
# Source file path
|
|
||||||
value = { source = "${assetPath}/${f}"; };
|
|
||||||
});
|
|
||||||
|
|
||||||
# Determine Hyprland package
|
|
||||||
hyprlandPkg =
|
|
||||||
pkgs.hyprland or
|
|
||||||
pkgs.hyprland-git or
|
|
||||||
inputs.hyprland.packages.${pkgs.system}.default;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
environment.systemPackages = [ hyprlandPkg ];
|
|
||||||
|
|
||||||
_module.args.hmUsers = {
|
|
||||||
${username} = {
|
|
||||||
home.packages = [ hyprlandPkg ];
|
|
||||||
|
|
||||||
# Merge all files in the asset folder into ~/.config/hypr/
|
|
||||||
home.file = lib.mkMerge hyprFiles;
|
|
||||||
|
|
||||||
# Optional: Hyprland settings
|
|
||||||
settings.general."col.active_border" = "0xff97cbcd 0xff89b4fa";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
{ lib, config, pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
username = config.defaultUser or "henrov";
|
|
||||||
moduleName = "stylix";
|
|
||||||
|
|
||||||
# Path to stylix assets
|
|
||||||
assetPath = ../../../assets/system/conf/${moduleName};
|
|
||||||
|
|
||||||
# Read all files in the asset directory
|
|
||||||
programFiles = builtins.readDir assetPath;
|
|
||||||
|
|
||||||
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
|
|
||||||
source = "${assetPath}/${name}";
|
|
||||||
});
|
|
||||||
|
|
||||||
# Optional stylix.conf
|
|
||||||
stylixConfFile = "${assetPath}/stylix.conf";
|
|
||||||
stylixConf =
|
|
||||||
if builtins.pathExists stylixConfFile
|
|
||||||
then builtins.readFile stylixConfFile
|
|
||||||
else "";
|
|
||||||
|
|
||||||
# Cursor defaults
|
|
||||||
cursorName = "phinger-cursors-light";
|
|
||||||
cursorSize = 24;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
############################
|
|
||||||
# System packages
|
|
||||||
############################
|
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.feh
|
|
||||||
pkgs.st
|
|
||||||
];
|
|
||||||
|
|
||||||
############################
|
|
||||||
# Home Manager user settings
|
|
||||||
############################
|
|
||||||
# Use the _module.args.hmUsers style to avoid "option does not exist"
|
|
||||||
_module.args.hmUsers = {
|
|
||||||
"${username}" = {
|
|
||||||
# Copy all stylix config files into ~/.config/stylix/
|
|
||||||
xdg.configFile =
|
|
||||||
lib.mapAttrs' (name: value: {
|
|
||||||
name = "${moduleName}/${name}";
|
|
||||||
value = { inherit (value) source; };
|
|
||||||
}) files;
|
|
||||||
|
|
||||||
# Optionally include stylix.conf
|
|
||||||
home.file."${moduleName}/stylix.conf".text = stylixConf;
|
|
||||||
|
|
||||||
# Session variables
|
|
||||||
home.sessionVariables = {
|
|
||||||
STYLIX_CONF = "$HOME/.config/stylix/stylix.conf";
|
|
||||||
|
|
||||||
XCURSOR_THEME = cursorName;
|
|
||||||
XCURSOR_SIZE = toString cursorSize;
|
|
||||||
HYPRCURSOR_THEME = cursorName;
|
|
||||||
HYPRCURSOR_SIZE = toString cursorSize;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable GTK target for Stylix
|
|
||||||
stylix = {
|
|
||||||
enable = true;
|
|
||||||
targets = {
|
|
||||||
gtk = { enable = true; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
waybarPath = "${pkgs.waybar}/bin/waybar";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
# Enable a user systemd service for Waybar
|
|
||||||
systemd.user.services.waybar = {
|
|
||||||
description = "Waybar for Hyprland";
|
|
||||||
after = [ "graphical.target" ];
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = "${waybarPath}";
|
|
||||||
Restart = "always";
|
|
||||||
Environment = [
|
|
||||||
"WAYLAND_DISPLAY=${config.environment.sessionVariables.WAYLAND_DISPLAY or "wayland-0"}"
|
|
||||||
"XDG_CURRENT_DESKTOP=Hyprland"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
wantedBy = [ "default.target" ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{ lib, config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
#################################
|
|
||||||
# Core Wayland packages
|
|
||||||
#################################
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
wayland
|
|
||||||
wl-clipboard # optional but commonly used for copy/paste
|
|
||||||
];
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Optional: enable graphics stack
|
|
||||||
#################################
|
|
||||||
hardware.graphics.enable = true;
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Optional session variables for Wayland
|
|
||||||
#################################
|
|
||||||
environment.sessionVariables = {
|
|
||||||
# Forces some apps to use Wayland
|
|
||||||
NIXOS_OZONE_WL = "1";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
{ lib, config, pkgs, inputs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
#################################
|
|
||||||
# Default username fallback
|
|
||||||
#################################
|
|
||||||
username = config.defaultUser or "henrov";
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Determine XDG portal package
|
|
||||||
#################################
|
|
||||||
xdgPortalHyprlandPkg =
|
|
||||||
pkgs.xdg-desktop-portal-hyprland or
|
|
||||||
inputs.xdgPortalHyprland.packages.${pkgs.system}.default;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
#################################
|
|
||||||
# System-wide packages
|
|
||||||
#################################
|
|
||||||
environment.systemPackages = [
|
|
||||||
xdgPortalHyprlandPkg
|
|
||||||
];
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Home Manager user config
|
|
||||||
#################################
|
|
||||||
_module.args.hmUsers = {
|
|
||||||
${username} = {
|
|
||||||
home.packages = [
|
|
||||||
xdgPortalHyprlandPkg
|
|
||||||
];
|
|
||||||
|
|
||||||
# Enable XDG portal integration for Hyprland
|
|
||||||
xdg.portal = {
|
|
||||||
enable = true;
|
|
||||||
extraPortals = [ xdgPortalHyprlandPkg ];
|
|
||||||
config.hyprland = {
|
|
||||||
"org.freedesktop.impl.portal.Screencast" = [ "hyprland" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Enable classic D-Bus service
|
|
||||||
services.dbus.enable = true;
|
|
||||||
|
|
||||||
# Use default dbus package (classic D-Bus)
|
|
||||||
services.dbus.dbusPackage = pkgs.dbus;
|
|
||||||
|
|
||||||
# Include some essential system packages so shell and tools exist
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
bashInteractive
|
|
||||||
coreutils
|
|
||||||
];
|
|
||||||
|
|
||||||
# Do not attempt to wrap dbus-daemon-launch-helper manually
|
|
||||||
# No extra security.wrappers needed
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
tuigreetBin = "${pkgs.tuigreet}/bin/tuigreet";
|
|
||||||
sessionsDir = "${pkgs.hyprland}/share/wayland-sessions";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
#################################
|
|
||||||
# Greetd (tuigreet)
|
|
||||||
#################################
|
|
||||||
|
|
||||||
services.greetd = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
default_session = {
|
|
||||||
command = ''
|
|
||||||
${tuigreetBin} \
|
|
||||||
--time \
|
|
||||||
--remember \
|
|
||||||
--remember-session \
|
|
||||||
--sessions ${sessionsDir} \
|
|
||||||
--cmd "start-hyprland"
|
|
||||||
'';
|
|
||||||
user = "greeter";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Fix TTY / boot noise issues
|
|
||||||
#################################
|
|
||||||
|
|
||||||
systemd.services.greetd.serviceConfig = {
|
|
||||||
Type = "idle";
|
|
||||||
StandardInput = "tty";
|
|
||||||
StandardOutput = "tty";
|
|
||||||
StandardError = "journal";
|
|
||||||
|
|
||||||
# Prevent boot log spam on tty
|
|
||||||
TTYReset = true;
|
|
||||||
TTYVHangup = true;
|
|
||||||
TTYVTDisallocate = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
{ lib, config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
#################################
|
|
||||||
# Networking core
|
|
||||||
#################################
|
|
||||||
networking = {
|
|
||||||
# Let DHCP be default unless overridden elsewhere
|
|
||||||
useDHCP = lib.mkDefault true;
|
|
||||||
|
|
||||||
# Hostname comes from host.nix, do NOT redefine here
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# NetworkManager (primary stack)
|
|
||||||
#################################
|
|
||||||
networkmanager = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# Use iwd backend for WiFi
|
|
||||||
wifi.backend = "iwd";
|
|
||||||
};
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# iwd (WiFi daemon)
|
|
||||||
#################################
|
|
||||||
wireless.iwd = {
|
|
||||||
enable = true;
|
|
||||||
# Allow user control via NM / CLI
|
|
||||||
settings.General.EnableNetworkConfiguration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Firewall
|
|
||||||
#################################
|
|
||||||
firewall = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# KDE Connect support
|
|
||||||
allowedTCPPortRanges = [
|
|
||||||
{ from = 1714; to = 1764; }
|
|
||||||
];
|
|
||||||
|
|
||||||
allowedUDPPortRanges = [
|
|
||||||
{ from = 1714; to = 1764; }
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# System packages
|
|
||||||
#################################
|
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.networkmanager
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{ lib, config, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
nix.settings = {
|
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
download-buffer-size = 536870912; # 512 MB
|
|
||||||
cores = 2;
|
|
||||||
max-jobs = 1;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
{ config, pkgs, lib, flakeRoot, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
username = config.users.users.defaultUser or "henrov";
|
|
||||||
homeDir = "/home/${username}";
|
|
||||||
assetPath = "${flakeRoot}/assets/copy_2_home";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
environment.systemPackages = [ pkgs.rsync ];
|
|
||||||
|
|
||||||
systemd.services.copyAssets = {
|
|
||||||
description = "Copy assets to ${username}'s home directory";
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
|
|
||||||
# oneshot service runs once at boot
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
|
|
||||||
# Always use /bin/sh -c for multi-line commands
|
|
||||||
serviceConfig.ExecStart = ''
|
|
||||||
/bin/sh -c '
|
|
||||||
echo "Copying assets from ${assetPath} to ${homeDir} ..."
|
|
||||||
|
|
||||||
if [ ! -d "${assetPath}" ]; then
|
|
||||||
echo "ERROR: ${assetPath} does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "${homeDir}"
|
|
||||||
chown ${username}:${username} "${homeDir}"
|
|
||||||
|
|
||||||
${pkgs.rsync}/bin/rsync -a --no-owner --no-group "${assetPath}/" "${homeDir}/"
|
|
||||||
|
|
||||||
# Fix .config permissions
|
|
||||||
mkdir -p "${homeDir}/.config"
|
|
||||||
chown -R ${username}:${username} "${homeDir}/.config"
|
|
||||||
chmod u+rwx "${homeDir}/.config"
|
|
||||||
|
|
||||||
echo "Done copying assets."
|
|
||||||
'
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
{ lib, config, pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
username = "henrov";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# NixOS system user
|
|
||||||
#################################
|
|
||||||
users.users.${username} = {
|
|
||||||
isNormalUser = true;
|
|
||||||
home = "/home/${username}";
|
|
||||||
hashedPassword = "$6$S7iShgBxB.77CwmP$i0njK.2r3OL5UEvgZbmwZ0rnpZ4QyJcv8p9uCmJ4AiVPSMXkQkIwMLzyAOnJ0q8.tPLIp/7EquEIZeK8qbmgw/";
|
|
||||||
extraGroups = [ "wheel" "networkmanager" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Home Manager user definition
|
|
||||||
#################################
|
|
||||||
_module.args.hmUsers = {
|
|
||||||
${username} = {
|
|
||||||
# Minimal required
|
|
||||||
home.username = username;
|
|
||||||
home.homeDirectory = "/home/${username}";
|
|
||||||
home.stateVersion = "26.05";
|
|
||||||
|
|
||||||
# Add user-specific packages here
|
|
||||||
home.packages = [
|
|
||||||
];
|
|
||||||
|
|
||||||
# Add user dotfiles, session variables, etc. here if needed
|
|
||||||
home.file = {
|
|
||||||
# Example:
|
|
||||||
# ".bashrc" = { source = /path/to/bashrc; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user