emacs has been adapted
This commit is contained in:
+288
-448
@@ -1,448 +1,288 @@
|
||||
#+title: Droidnix: A Dendritic NixOS + Home Manager Configuration
|
||||
#+author: Henro Veijer
|
||||
#+options: toc:t num:nil htmlize:nil
|
||||
#+language: en
|
||||
#+html_head: <style>pre.src { background-color: #1e1e2e; color: #cdd6f4; padding: 1em; border-radius: 4px; }</style>
|
||||
|
||||
|
||||
* Table of Contents
|
||||
[[#introduction][Introduction]]
|
||||
[[#the-assets-folder][The Assets Folder]]
|
||||
[[#the-actual-code][The Actual Code]]
|
||||
|
||||
---
|
||||
|
||||
* Introduction :intro:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: introduction
|
||||
:END:
|
||||
** What is Droidnix
|
||||
Droidnix is a modular, declarative NixOS + Home Manager configuration system. It allows users to choose between =Hyprland= and =Mangowc= as their window manager, with shared and WM-specific configurations managed via Emacs Org and Nix Flakes. The project is designed for reproducibility, maintainability, and cross-machine compatibility.
|
||||
|
||||
** Folder Structure and Goals
|
||||
The Droidnix repository is organized into two main parts:
|
||||
1. =.assets/=: Static, non-generated files (e.g., configs, scripts, themes).
|
||||
2. Generated folders (=common=, =hyprland=, =mangowc=): NixOS and Home Manager configurations, generated from Org files.
|
||||
|
||||
#+BEGIN_EXAMPLE
|
||||
.
|
||||
├── assets
|
||||
│ ├── common
|
||||
│ │ ├── conf
|
||||
│ │ │ └── base.conf
|
||||
│ │ ├── emacs
|
||||
│ │ │ └── setup_emacs.sh
|
||||
│ │ └── scripts
|
||||
│ ├── hyprland
|
||||
│ │ ├── conf
|
||||
│ │ ├── scripts
|
||||
│ │ └── themes
|
||||
│ ├── machines
|
||||
│ │ ├── maindroid
|
||||
│ │ │ └── configuration.nix
|
||||
│ │ └── traveldroid
|
||||
│ │ └── configuration.nix
|
||||
│ └── mangowc
|
||||
│ ├── conf
|
||||
│ ├── scripts
|
||||
│ └── themes
|
||||
├── flake.nix
|
||||
├── generated
|
||||
│ ├── common
|
||||
│ │ ├── home-manager
|
||||
│ │ │ ├── programs
|
||||
│ │ │ ├── shell
|
||||
│ │ │ └── starship
|
||||
│ │ ├── nixos
|
||||
│ │ │ ├── hardware
|
||||
│ │ │ ├── packages
|
||||
│ │ │ ├── security
|
||||
│ │ │ ├── services
|
||||
│ │ │ └── users
|
||||
│ │ ├── templates
|
||||
│ │ └── themes
|
||||
│ │ ├── fonts
|
||||
│ │ ├── gtk
|
||||
│ │ ├── icons
|
||||
│ │ └── shells
|
||||
│ ├── hyprland
|
||||
│ │ ├── home-manager
|
||||
│ │ │ ├── programs
|
||||
│ │ │ └── scripts
|
||||
│ │ ├── nixos
|
||||
│ │ │ ├── plugins
|
||||
│ │ │ └── window-manager
|
||||
│ │ ├── overrides
|
||||
│ │ └── themes
|
||||
│ │ ├── hypr
|
||||
│ │ ├── rofi
|
||||
│ │ └── waybar
|
||||
│ └── mangowc
|
||||
│ ├── home-manager
|
||||
│ │ ├── programs
|
||||
│ │ └── scripts
|
||||
│ ├── nixos
|
||||
│ │ ├── plugins
|
||||
│ │ └── window-manager
|
||||
│ ├── overrides
|
||||
│ └── themes
|
||||
│ ├── mangowc
|
||||
│ ├── waybar
|
||||
│ └── wofi
|
||||
├── README.html
|
||||
└── README.org
|
||||
#+END_EXAMPLE
|
||||
|
||||
** First Setup
|
||||
1. Clone this repository.
|
||||
2. Run the setup script: =./setup_droidnix.sh=.
|
||||
3. Edit =.assets/common/conf/base.conf= to choose your window manager (=wm = "hyprland"= or =wm = "mangowc"=).
|
||||
4. Tangle this Org file to generate Nix configurations: =C-c C-v t= in Emacs or use this: =emacs README.org --batch -f org-babel-tangle && emacs --batch --eval "(setq org-html-htmlize-output-type nil)" README.org -f org-html-export-to-html=
|
||||
5. Build and switch: =sudo nixos-rebuild switch --flake .#<hostname>=.
|
||||
|
||||
---
|
||||
|
||||
* The Assets Folder :assets:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: the-assets-folder
|
||||
:END:
|
||||
The =.assets/= folder contains all static files, such as configs, scripts, and themes. These files are not generated and can be edited directly.
|
||||
|
||||
** =.assets/common/=
|
||||
This folder contains files shared across both window managers, such as wallpapers, shell configs, and common scripts.
|
||||
|
||||
- =conf/base.conf=: Defines the window manager choice and other global settings.
|
||||
- =scripts/=: System-wide scripts (e.g., utilities, helpers).
|
||||
|
||||
** =.assets/hyprland/=
|
||||
Hyprland-specific assets, including configs, themes, and scripts.
|
||||
|
||||
- =conf/=: Hyprland configuration files (e.g., =hyprland.conf=).
|
||||
- =themes/=: Hyprland-specific theme scripts.
|
||||
- =scripts/=: Hyprland-specific scripts.
|
||||
|
||||
** =.assets/mangowc/=
|
||||
Mangowc-specific assets, including configs, themes, and scripts.
|
||||
|
||||
- =conf/=: Mangowc configuration files.
|
||||
- =themes/=: Mangowc-specific theme scripts.
|
||||
- =scripts/=: Mangowc-specific scripts.
|
||||
|
||||
** =.assets/machines/=
|
||||
Machine-specific NixOS configurations (e.g., =configuration.nix= for =maindroid= and =traveldroid=).
|
||||
|
||||
---
|
||||
|
||||
* The Actual Code :code:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: the-actual-code
|
||||
:END:
|
||||
This section contains the Org blocks for tangling Nix code into the generated folders.
|
||||
|
||||
** =flake.nix=
|
||||
The Nix flake definition for Droidnix.
|
||||
|
||||
#+begin_src nix :tangle flake.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{
|
||||
description = "Droidnix: A dendritic NixOS + Home Manager configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, ... }@inputs: {
|
||||
# Your flake outputs here
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/nixos/hardware/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/nixos/hardware/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/nixos/hardware/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your hardware configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/nixos/packages/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/nixos/packages/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/nixos/packages/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your package configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/nixos/security/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/nixos/security/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/nixos/security/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your security configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/nixos/services/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/nixos/services/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/nixos/services/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your service configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/nixos/users/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/nixos/users/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/nixos/users/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your user configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/home-manager/programs/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/home-manager/programs/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/home-manager/programs/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your program configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/home-manager/shell/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/home-manager/shell/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/home-manager/shell/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your shell configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/home-manager/starship/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/home-manager/starship/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/home-manager/starship/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your starship configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/templates/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/templates/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/templates/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your template configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/themes/fonts/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/themes/fonts/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/themes/fonts/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your font configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/themes/gtk/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/themes/gtk/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/themes/gtk/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your GTK theme configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/themes/icons/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/themes/icons/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/themes/icons/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your icon configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/common/themes/shells/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/common/themes/shells/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/common/themes/shells/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your shell theme configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/hyprland/nixos/window-manager/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/hyprland/nixos/window-manager/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/hyprland/nixos/window-manager/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Hyprland window manager configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/hyprland/nixos/plugins/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/hyprland/nixos/plugins/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/hyprland/nixos/plugins/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Hyprland plugin configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/hyprland/home-manager/programs/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/hyprland/home-manager/programs/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/hyprland/home-manager/programs/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Hyprland program configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/hyprland/home-manager/scripts/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/hyprland/home-manager/scripts/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/hyprland/home-manager/scripts/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Hyprland script configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/hyprland/themes/hypr/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/hyprland/themes/hypr/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/hyprland/themes/hypr/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Hyprland theme configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/hyprland/themes/rofi/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/hyprland/themes/rofi/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/hyprland/themes/rofi/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Rofi theme configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/hyprland/themes/waybar/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/hyprland/themes/waybar/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/hyprland/themes/waybar/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Waybar theme configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/hyprland/overrides/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/hyprland/overrides/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/hyprland/overrides/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Hyprland overrides here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/mangowc/nixos/window-manager/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/mangowc/nixos/window-manager/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/mangowc/nixos/window-manager/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Mangowc window manager configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/mangowc/nixos/plugins/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/mangowc/nixos/plugins/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/mangowc/nixos/plugins/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Mangowc plugin configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/mangowc/home-manager/programs/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/mangowc/home-manager/programs/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/mangowc/home-manager/programs/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Mangowc program configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/mangowc/home-manager/scripts/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/mangowc/home-manager/scripts/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/mangowc/home-manager/scripts/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Mangowc script configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/mangowc/themes/generated/mangowc/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/mangowc/themes/generated/mangowc/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/mangowc/themes/generated/mangowc/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Mangowc theme configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/mangowc/themes/waybar/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/mangowc/themes/waybar/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/mangowc/themes/waybar/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Waybar theme configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/mangowc/themes/wofi/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/mangowc/themes/wofi/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/mangowc/themes/wofi/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Wofi theme configurations here
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** =generated/mangowc/overrides/placeholder.nix=
|
||||
This is a placeholder for the description of =generated/mangowc/overrides/placeholder.nix=.
|
||||
|
||||
#+begin_src nix :tangle generated/mangowc/overrides/placeholder.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ pkgs, user, ... }:
|
||||
{
|
||||
# Your Mangowc overrides here
|
||||
}
|
||||
#+end_src
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Droidnix: Install Emacs and configure for Nix/Org tangling, HTML export
|
||||
# For NixOS systems with no Emacs installed
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Install Emacs and dependencies via nix-shell
|
||||
echo "Installing Emacs and dependencies via nix-shell..."
|
||||
nix-shell -p emacs git --run "
|
||||
# Create a minimal Emacs config for package installation
|
||||
TEMP_CONFIG=\$(mktemp /tmp/droidnix-emacs-setup.XXXXXX.el)
|
||||
cat > \"\$TEMP_CONFIG\" << 'EOC'
|
||||
;; Minimal config for installing packages
|
||||
(require 'package)
|
||||
(add-to-list 'package-archives '(\"melpa\" . \"https://melpa.org/packages/\") t)
|
||||
(package-initialize)
|
||||
EOC
|
||||
|
||||
# Install Emacs 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\" << 'EOC'
|
||||
;; 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)
|
||||
(menu-bar-mode -1)
|
||||
(scroll-bar-mode -1)
|
||||
(setq inhibit-startup-message t)
|
||||
(setq make-backup-files nil)
|
||||
(setq auto-save-default nil)
|
||||
|
||||
;; Enable Catppuccin Mocha theme
|
||||
(when (fboundp 'load-theme)
|
||||
(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
|
||||
(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\")))
|
||||
EOC
|
||||
fi
|
||||
|
||||
# Clean up
|
||||
rm \"\$TEMP_CONFIG\"
|
||||
|
||||
echo ''
|
||||
echo 'Emacs and all packages are now installed and configured!'
|
||||
echo ''
|
||||
echo 'Installed packages:'
|
||||
echo ' ✅ Catppuccin Mocha (theme)'
|
||||
echo ' ✅ Org mode + Org Bullets'
|
||||
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 (shell support for Org Babel)'
|
||||
echo ' ✅ ob-nix (Nix support for Org Babel)'
|
||||
echo ' ✅ Dashboard (start page)'
|
||||
echo ' ✅ tree (for directory visualization)'
|
||||
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'
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user