Regenerated

This commit is contained in:
2026-03-19 15:06:09 +00:00
parent 9e2427402f
commit 85ace71da9
28 changed files with 1515 additions and 0 deletions
@@ -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
@@ -0,0 +1,61 @@
{ lib, pkgs, config, ... }:
let
flatpakConfPath = ../../../assets/system/apps/flatpaks.conf;
enableProgram = config.enableFlatpaks or false;
in
{
# Top-level toggle
options.enableFlatpaks = lib.mkEnableOption "Enable automatic Flatpak installation";
# Config assignments
config = lib.mkIf enableProgram {
# Use programs.flatpaks instead of myApps.flatpaks
programs.flatpaks = {
enable = true;
user = config.defaultUser or "henrov";
assetsDir = flatpakConfPath;
files = []; # handled at runtime
};
# Deploy the conf file
environment.etc."flatpak/flatpaks.conf".source = flatpakConfPath;
# Enable system flatpak service
services.flatpak.enable = true;
xdg.portal.enable = true;
# Systemd service for installing listed flatpaks
systemd.services.flatpak-sync = {
description = "Install Flatpak apps listed in flatpaks.conf";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = ''
set -euo pipefail
CONF="${flatpakConfPath}"
if ! flatpak remotes --system --columns=name | grep -qx flathub; then
flatpak remote-add --system --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
fi
while IFS= read -r app || [ -n "$app" ]; do
app=$(echo "$app" | sed 's/#.*//;s/^[[:space:]]*//;s/[[:space:]]*$//')
if [ -n "$app" ]; then
if ! flatpak info --system "$app" >/dev/null 2>&1; then
flatpak install --system -y --noninteractive flathub "$app"
fi
fi
done < "$CONF"
'';
};
restartTriggers = [ flatpakConfPath ];
path = [ pkgs.flatpak pkgs.coreutils pkgs.gnugrep pkgs.gnused ];
};
};
}
@@ -0,0 +1,24 @@
{ lib, pkgs, config, ... }:
let
enableProgram = config.enableThunar or false;
in
{
# Top-level toggle
options.enableThunar = lib.mkEnableOption "Enable Thunar file manager";
# Config assignments
config = lib.mkIf enableProgram {
# Replace myApps.thunar with programs.thunar (or your own flat container)
programs.thunar = {
user = config.defaultUser or "henrov";
# Add extra Thunar options here
};
environment.systemPackages = [
pkgs.thunar
pkgs.thunar-plugins
pkgs.xarchiver
];
};
}
+57
View File
@@ -0,0 +1,57 @@
{ lib, config, ... }:
let
# --- Program definition ---
programName = "wofi";
# Path to assets
assetPath = ../../../assets/system/conf/${programName};
# Generate file mappings
programFiles =
if builtins.pathExists assetPath then builtins.readDir assetPath else {};
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
src = "${assetPath}/${name}";
});
# Top-level toggle for this module
enableProgram = config.enableWofi or false;
# Default user
username = config.defaultUser or "henrov";
in
{
# --- Module option ---
options.enableWofi = lib.mkEnableOption "Enable Wofi terminal launcher";
# --- Config ---
config = lib.mkIf enableProgram {
# --- Deploy assets to ~/.config/wofi ---
environment.etc."${programName}".source = assetPath;
# --- Optional systemd service to sync config ---
systemd.services."${programName}-sync" = {
description = "Sync ${programName} configuration files";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = ''
set -euo pipefail
if [ -d "${assetPath}" ]; then
for f in ${lib.concatStringsSep " " (builtins.attrNames files)}; do
mkdir -p "/home/${username}/.config/${programName}"
cp -u "${assetPath}/$f" "/home/${username}/.config/${programName}/$f"
done
fi
'';
};
restartTriggers = [ assetPath ];
path = [];
};
};
}
@@ -0,0 +1,62 @@
{ lib, config, pkgs, ... }:
let
# --- Program definition ---
programName = "zenbrowser";
# Assets (optional, empty if no config)
assetPath =
if builtins.pathExists ../../../assets/system/conf/${programName}
then ../../../assets/system/conf/${programName}
else null;
programFiles =
if assetPath != null then builtins.readDir assetPath else {};
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
src = "${assetPath}/${name}";
});
# Top-level toggle for this module
enableProgram = config.enableZenBrowser or false;
# Default user fallback
username = config.defaultUser or "henrov";
in
{
# --- Option ---
options.enableZenBrowser = lib.mkEnableOption "Install Zen Browser";
# --- Config ---
config = lib.mkIf enableProgram {
# --- Deploy assets (if any) ---
environment.etc."${programName}".source = assetPath;
# --- System packages ---
environment.systemPackages = [ pkgs.zen-browser ];
# --- Example systemd service to sync assets ---
systemd.services."${programName}-sync" = {
description = "Sync ${programName} configuration files";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = ''
set -euo pipefail
if [ -d "${assetPath}" ]; then
for f in ${lib.concatStringsSep " " (builtins.attrNames files)}; do
cp -u "${assetPath}/$f" "/home/${username}/.config/${programName}/$f"
done
fi
'';
};
restartTriggers = [ assetPath ];
path = [];
};
};
}
@@ -0,0 +1,12 @@
{ lib, pkgs, config, ... }:
{
options.enableFonts = lib.mkEnableOption "Enable nerd fonts";
config = lib.mkIf (config.enableFonts or false) {
fonts.packages = with pkgs; [
nerd-fonts.iosevka
nerd-fonts.fira-code
];
};
}
@@ -0,0 +1,93 @@
{ lib, config, ... }:
let
# --- Module variables ---
moduleName = "hyprland";
username = config.defaultUser or "henrov";
# Assets directory
assetPath = ../../../assets/hyprland/conf/hypr;
# Read all files except main config
allFiles =
if builtins.pathExists assetPath
then builtins.readDir assetPath
else {};
otherFiles = lib.filter (name: name != "hyprland.conf") (builtins.attrNames allFiles);
files = lib.genAttrs otherFiles (name: {
src = "${assetPath}/${name}";
});
# Main config (inline)
mainConfigPath =
if builtins.pathExists "${assetPath}/hyprland.conf"
then "${assetPath}/hyprland.conf"
else null;
# Top-level toggle
enableProgram = config.enableHyprland or false;
in
{
# --- Option ---
options.enableHyprland = lib.mkEnableOption "Enable Hyprland desktop";
# --- Config ---
config = lib.mkIf enableProgram {
# Enable Hyprland programmatically
programs.hyprland.enable = true;
# --- Home Manager wiring ---
home-manager.users.${username} = {
home.stateVersion = "26.05";
home.username = username;
home.homeDirectory = "/home/${username}";
wayland.windowManager.hyprland = {
enable = true;
settings.general."col.active_border" = lib.mkForce "0xff97cbcd 0xff89b4fa";
};
# Deploy config files
xdg.configFile =
(lib.mapAttrs' (name: value: {
name = "hypr/${name}";
value.source = value.src;
}) files)
// (if mainConfigPath != null then {
"hypr/hyprland.conf".text = builtins.readFile mainConfigPath;
} else {})
// {
"hypr/.keep".text = "";
};
};
# --- Optional: systemd service to sync configs ---
systemd.services."${moduleName}-sync" = {
description = "Sync ${moduleName} configuration files";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = ''
set -euo pipefail
if [ -d "${assetPath}" ]; then
for f in ${lib.concatStringsSep " " (builtins.attrNames files)}; do
cp -u "${assetPath}/$f" "/home/${username}/.config/${moduleName}/$f"
done
fi
if [ -f "${mainConfigPath}" ]; then
cp -u "${mainConfigPath}" "/home/${username}/.config/${moduleName}/hyprland.conf"
fi
'';
};
restartTriggers = [ assetPath ];
path = [];
};
};
}
@@ -0,0 +1,117 @@
{ lib, config, ... }:
let
# --- Module variables ---
moduleName = "stylix";
username = config.defaultUser or "henrov";
# Assets directory
assetPath =
if builtins.pathExists ../../../assets/system/theming/${moduleName}
then ../../../assets/system/theming/${moduleName}
else null;
# Read all files if assets exist
programFiles =
if assetPath != null
then builtins.readDir assetPath
else {};
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
src = "${assetPath}/${name}";
});
# Top-level toggle for this module
enableProgram = config.enableStylix or false;
# Stylix self-contained configuration
stylixCfg = {
enable = true;
base16Scheme = ../../../assets/system/theming/stylix/catppuccin-mocha.yaml;
image = ../../../assets/hyprland/wallpaperstuff/pictures/wall1.jpg;
polarity = "dark";
cursor = {
package = "phinger-cursors"; # symbolic reference
name = "phinger-cursors-light";
size = 24;
};
fonts = {
monospace = {
package = "nerd-fonts-fira-code";
name = "Fira Code Nerd Font";
};
sansSerif = {
package = "lato";
name = "Lato";
};
};
icons = {
enable = true;
package = "papirus-icon-theme";
dark = "Papirus-Dark";
light = "Papirus-Light";
};
};
in
{
# --- Top-level toggle option ---
options.enableStylix = lib.mkEnableOption "Enable Stylix system theming";
# --- Only apply configuration if enabled ---
config = lib.mkIf enableProgram {
# --- Stylix dendritic app definition ---
stylixModule = {
enable = true;
assetsDir = assetPath;
files = files;
user = username;
theme = "catppuccin-mocha";
polarity = "dark";
};
# --- Stylix theming config ---
stylix = stylixCfg;
# --- Optional wallpaper helper (dendritic) ---
wallpaperHelper = {
enable = true;
packages = [ "feh" "st" ]; # symbolic package names
};
# --- Cursor environment variables ---
home-manager.users.${username}.home.sessionVariables = {
XCURSOR_THEME = stylixCfg.cursor.name;
XCURSOR_SIZE = toString stylixCfg.cursor.size;
HYPRCURSOR_THEME = stylixCfg.cursor.name;
HYPRCURSOR_SIZE = toString stylixCfg.cursor.size;
};
# --- Optional systemd service to sync assets ---
systemd.services."${moduleName}-sync" = {
description = "Sync ${moduleName} configuration assets";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = ''
set -euo pipefail
if [ -d "${assetPath}" ]; then
for f in ${lib.concatStringsSep " " (builtins.attrNames files)}; do
cp -u "${assetPath}/$f" "/home/${username}/.config/${moduleName}/$f"
done
fi
'';
};
restartTriggers = [ assetPath ];
path = [];
};
};
}
@@ -0,0 +1,74 @@
{ lib, config, ... }:
let
# --- Module variables ---
moduleName = "waybar";
username = config.defaultUser or "henrov";
# Assets directory
assetPath =
if builtins.pathExists ../../../assets/system/conf/${moduleName}
then ../../../assets/system/conf/${moduleName}
else null;
# Read all files if assets exist
programFiles =
if assetPath != null
then builtins.readDir assetPath
else {};
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
src = "${assetPath}/${name}";
});
# Top-level toggle for this module
enableProgram = config.enableWaybar or false;
in
{
# --- Top-level toggle option ---
options.enableWaybar = lib.mkEnableOption "Enable Waybar status bar";
# --- Only apply configuration if enabled ---
config = lib.mkIf enableProgram {
# --- Dendritic container ---
waybar = {
enable = true;
user = username;
assetsDir = assetPath;
files = files;
};
# --- Deploy configuration to ~/.config/waybar ---
home-manager.users.${username} = lib.mkIf assetPath != null {
xdg.configFile =
lib.mapAttrs' (name: value: {
name = "${moduleName}/${name}";
value.source = value.src;
}) files;
};
# --- Optional systemd service to sync configs ---
systemd.services."${moduleName}-sync" = {
description = "Sync ${moduleName} configuration";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = ''
set -euo pipefail
if [ -d "${assetPath}" ]; then
for f in ${lib.concatStringsSep " " (builtins.attrNames files)}; do
cp -u "${assetPath}/$f" "/home/${username}/.config/${moduleName}/$f"
done
fi
'';
};
restartTriggers = [ assetPath ];
path = [];
};
};
}
@@ -0,0 +1,96 @@
{ lib, config, ... }:
let
# --- Module variables ---
moduleName = "wayland";
username = config.defaultUser or "henrov";
# Assets directory (optional)
assetPath =
if builtins.pathExists ../../../assets/system/conf/${moduleName}
then ../../../assets/system/conf/${moduleName}
else null;
programFiles =
if assetPath != null
then builtins.readDir assetPath
else {};
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
src = "${assetPath}/${name}";
});
# Top-level toggle for this module
enableProgram = config.enableWayland or true;
in
{
# --- Declare the top-level toggle ---
options.enableWayland = lib.mkEnableOption "Enable Wayland + portals";
# --- Only apply configuration if enabled ---
config = lib.mkIf enableProgram {
# Example dendritic container (flat, self-contained)
wayland = {
enable = true;
user = username;
assetsDir = assetPath;
files = files;
# Wayland-specific metadata
portals = [ "hyprland" ];
};
# Deploy assets to user's XDG config if they exist
home-manager.users.${username} = lib.mkIf assetPath != null {
xdg.configFile =
lib.mapAttrs' (name: value: {
name = "${moduleName}/${name}";
value.source = value.src;
}) files;
};
# Example portal + packages configuration
home-manager.users.${username} = {
xdg.portal = {
enable = true;
# Only reference pkgs if unavoidable
extraPortals = [
config.pkgs.xdg-desktop-portal-hyprland
];
config.hyprland = {
"org.freedesktop.impl.portal.Screencast" = [ "hyprland" ];
};
};
home.packages = [
config.pkgs.uwsm
];
};
# Optional systemd service to sync configs (if needed)
systemd.services."${moduleName}-sync" = {
description = "Sync ${moduleName} configuration";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = ''
set -euo pipefail
if [ -d "${assetPath}" ]; then
for f in ${lib.concatStringsSep " " (builtins.attrNames files)}; do
cp -u "${assetPath}/$f" "/home/${username}/.config/${moduleName}/$f"
done
fi
'';
};
restartTriggers = [ assetPath ];
path = [];
};
};
}
@@ -0,0 +1,72 @@
{ lib, config, ... }:
let
# --- Module variables ---
moduleName = "kitty";
username = config.defaultUser or "henrov";
# Path to program assets (relative, self-contained)
assetPath = ../../../assets/system/conf/${moduleName};
# Read all files in the assets directory
programFiles = builtins.readDir assetPath;
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
src = "${assetPath}/${name}";
});
# Top-level toggle for this module
enableProgram = config.enableKitty or true;
in
{
# --- Declare the top-level toggle ---
options.enableKitty = lib.mkEnableOption "Enable Kitty terminal integration";
# --- Only apply configuration if enabled ---
config = lib.mkIf enableProgram {
# Kitty program configuration
programs.kitty.enable = true;
programs.kitty.extraConfig = ''
# 1) Theme first
include themes/Catppuccin-Mocha.conf
# 2) Force transparency last
#background_opacity 0.60
#dynamic_background_opacity yes
'';
# Deploy configuration files to user's XDG config
home-manager.users.${username} = {
xdg.configFile =
lib.mapAttrs' (name: value: {
name = "${moduleName}/${name}";
value.source = value.src;
}) files;
};
# Example systemd service to sync assets to user's config directory
systemd.services."${moduleName}-sync" = {
description = "Sync ${moduleName} configuration";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = ''
set -euo pipefail
CONF="${assetPath}"
USER_HOME="/home/${username}"
for f in ${lib.concatStringsSep " " (builtins.attrNames files)}; do
cp -u "$CONF/$f" "$USER_HOME/.config/${moduleName}/$f"
done
'';
};
restartTriggers = [ assetPath ];
# Minimal PATH (no pkgs references needed unless necessary)
path = [ ];
};
};
}
@@ -0,0 +1,32 @@
{ lib, ... }:
let
# Path to your Starship config inside the flake
starshipAssets = ../../../assets/system/conf/starship.toml;
# Read and parse the TOML file as a symbolic value
starshipConfig = lib.importTOML starshipAssets;
# Toggle on/off
enableStarship = true;
in
{
# Declare a top-level module option
options.starship = {
enable = lib.mkEnableOption "Enable Starship prompt";
configFiles = lib.mkOption {
type = lib.types.attrsOf lib.types.any;
default = {};
description = "Symbolic Starship configuration files";
};
};
# Populate the option safely
config = lib.mkIf enableStarship {
starship.enable = true;
starship.configFiles = {
"starship.toml" = starshipConfig;
assetsDir = ../../../assets/system/conf;
};
};
}