initial config

This commit is contained in:
matiss
2026-04-20 15:08:47 +00:00
commit 8f4daf76b8
27 changed files with 1458 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
# ==========================================
# APPLICATIONS CONFIGURATION
# ==========================================
{ config, pkgs, inputs, ... }:
{
# XDG default applications
xdg.mimeApps = {
enable = true;
defaultApplications = {
"text/html" = "Alacritty.desktop";
"x-scheme-handler/http" = "Alacritty.desktop"; # Override with your browser .desktop
"x-scheme-handler/https" = "Alacritty.desktop";
"text/plain" = "nvim.desktop";
};
};
home.sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
BROWSER = "firefox"; # Placeholder — change to helium if installed
TERMINAL = "alacritty";
# Wayland-native rendering for Electron apps
NIXOS_OZONE_WL = "1";
# Fix Java Swing apps on Wayland
_JAVA_AWT_WM_NONREPARENTING = "1";
};
}

19
modules/user/dotfiles.nix Normal file
View File

@@ -0,0 +1,19 @@
# ==========================================
# DOTFILES — Symlink config files
# ==========================================
{ config, pkgs, ... }:
{
# Hyprland configuration
xdg.configFile."hypr/hyprland.conf".source = ../../config/hypr/hyprland.conf;
# Waybar
xdg.configFile."waybar/config.jsonc".source = ../../config/waybar/config.jsonc;
xdg.configFile."waybar/style.css".source = ../../config/waybar/style.css;
# Walker launcher
xdg.configFile."walker/config.toml".source = ../../config/walker/config.toml;
# Alacritty terminal
xdg.configFile."alacritty/alacritty.toml".source = ../../config/alacritty/alacritty.toml;
}

39
modules/user/git.nix Normal file
View File

@@ -0,0 +1,39 @@
# ==========================================
# GIT CONFIGURATION
# ==========================================
{ config, pkgs, ... }:
{
programs.git = {
enable = true;
settings = {
user = {
name = "Matiss"; # CHANGE ME
email = "your-email@users.noreply.github.com"; # CHANGE ME
};
# SSH for GitHub by default
url."git@github.com:".insteadOf = "https://github.com/";
init.defaultBranch = "main";
diff.algorithm = "histogram";
push = {
autoSetupRemote = true;
default = "current";
};
};
};
# SSH — GitHub key
programs.ssh = {
enable = true;
matchBlocks."github.com" = {
identityFile = "/home/matiss/.ssh/id_ed25519"; # CHANGE ME to your key path
identitiesOnly = true;
};
matchBlocks."*" = {
setEnv.TERM = "xterm-256color";
};
};
}

131
modules/user/neovim.nix Normal file
View File

@@ -0,0 +1,131 @@
# ==========================================
# NEOVIM CONFIGURATION (via Nixvim)
# ==========================================
# Gruvbox theme, LSP, Treesitter, Telescope, file tree.
# ==========================================
{ config, pkgs, ... }:
{
programs.nixvim = {
enable = true;
opts = {
number = true;
relativenumber = true;
shiftwidth = 2;
tabstop = 2;
expandtab = true;
smartindent = true;
wrap = false;
swapfile = false;
backup = false;
undofile = true;
hlsearch = false;
incsearch = true;
termguicolors = true;
scrolloff = 8;
signcolumn = "yes";
updatetime = 50;
clipboard = "unnamedplus";
};
globals = {
mapleader = " ";
maplocalleader = " ";
};
# Gruvbox colorscheme — matches omarchy aesthetic
colorschemes.gruvbox = {
enable = true;
settings = {
contrast_dark = "hard";
transparent_mode = true;
};
};
# Treesitter (syntax highlighting)
plugins.treesitter = {
enable = true;
settings.highlight.enable = true;
settings.indent.enable = true;
};
# Telescope (fuzzy finder)
plugins.telescope = {
enable = true;
keymaps = {
"<leader>ff" = { action = "find_files"; options.desc = "Find files"; };
"<leader>fg" = { action = "live_grep"; options.desc = "Live grep"; };
"<leader>fb" = { action = "buffers"; options.desc = "Buffers"; };
"<leader>fh" = { action = "help_tags"; options.desc = "Help tags"; };
"<leader>fr" = { action = "oldfiles"; options.desc = "Recent files"; };
};
};
# Neo-tree (file tree)
plugins.neo-tree = {
enable = true;
};
# LSP
plugins.lsp = {
enable = true;
servers = {
nil_ls.enable = true; # Nix
pyright.enable = true; # Python
ts_ls.enable = true; # TypeScript/JavaScript
bashls.enable = true; # Bash
jsonls.enable = true; # JSON
yamlls.enable = true; # YAML
html.enable = true; # HTML
cssls.enable = true; # CSS
};
};
# Autocompletion
plugins.cmp = {
enable = true;
autoEnableSources = true;
settings = {
sources = [
{ name = "nvim_lsp"; }
{ name = "path"; }
{ name = "buffer"; }
];
mapping = {
"<C-n>" = "cmp.mapping.select_next_item()";
"<C-p>" = "cmp.mapping.select_prev_item()";
"<C-y>" = "cmp.mapping.confirm({ select = true })";
"<C-Space>" = "cmp.mapping.complete()";
};
};
};
# Status line
plugins.lualine = {
enable = true;
settings.options.theme = "gruvbox";
};
# Autopairs
plugins.nvim-autopairs.enable = true;
# Git signs in the gutter
plugins.gitsigns.enable = true;
# Which-key (show keybindings)
plugins.which-key.enable = true;
# Keymaps
keymaps = [
{ key = "<leader>e"; action = "<cmd>Neotree toggle<CR>"; options.desc = "Toggle file tree"; }
{ key = "<leader>w"; action = "<cmd>w<CR>"; options.desc = "Save"; }
{ key = "<leader>q"; action = "<cmd>q<CR>"; options.desc = "Quit"; }
# Window navigation
{ key = "<C-h>"; action = "<C-w>h"; options.desc = "Move left"; }
{ key = "<C-j>"; action = "<C-w>j"; options.desc = "Move down"; }
{ key = "<C-k>"; action = "<C-w>k"; options.desc = "Move up"; }
{ key = "<C-l>"; action = "<C-w>l"; options.desc = "Move right"; }
];
};
}

90
modules/user/packages.nix Normal file
View File

@@ -0,0 +1,90 @@
# ==========================================
# PACKAGES — User Applications
# ==========================================
# Spec: Codex, Claude Code, Gemini CLI, Helium, Cursor,
# Antigravity, Lazydocker, Git, Gh, Alacritty,
# Zoxide, Fzf, Bat, Eza, Fd, Impala, Bun, Nodejs,
# Docker, Bitwarden, Beeper, Python, Spotify, Tailscale
# ==========================================
{ config, pkgs, inputs, ... }:
{
home.packages = with pkgs; [
# ── AI Coding Tools ──────────────────────────────────
unstable.claude-code # Claude Code CLI
unstable.antigravity # Antigravity IDE
# codex: install via `npm i -g @openai/codex` (not in nixpkgs)
# gemini-cli: install via `npm i -g @google/gemini-cli` (not in nixpkgs)
# ── Terminals & Editors ──────────────────────────────
alacritty # GPU-accelerated terminal
code-cursor # Cursor IDE
# ── Browsers ─────────────────────────────────────────
# Helium: add inputs.helium-browser flake package here
# if the flake builds for your system, uncomment:
# inputs.helium-browser.packages.${pkgs.stdenv.hostPlatform.system}.default
# ── CLI Essentials (omarchy-style) ───────────────────
bat # cat with syntax highlighting
eza # modern ls
fd # modern find
fzf # fuzzy finder
zoxide # smart cd
ripgrep # fast grep
lazydocker # Docker TUI
impala # TUI WiFi manager
yazi # TUI file manager
btop # system monitor
fastfetch # system info
tealdeer # tldr man pages
# ── Version Control ──────────────────────────────────
git
gh # GitHub CLI
lazygit # Git TUI
# ── Development Runtimes ─────────────────────────────
nodejs
bun
python3
uv # fast Python package manager
# ── Containers ───────────────────────────────────────
docker-compose
# ── Desktop Apps ─────────────────────────────────────
bitwarden # password manager
beeper # unified messaging
spotify # music
# ── System Utilities ─────────────────────────────────
wget
curl
unzip
wl-clipboard
cliphist
wl-clip-persist
# ── Theming Dependencies ─────────────────────────────
gnome-themes-extra
adwaita-qt
adwaita-qt6
dconf
];
# ── Post-activation: Install npm-only tools ────────────
# Codex and Gemini CLI aren't in nixpkgs; install them
# globally via npm after first `nixos-rebuild switch`.
home.activation.installNpmTools = config.lib.dag.entryAfter [ "writeBoundary" ] ''
export PATH="${pkgs.nodejs}/bin:$PATH"
if ! command -v codex &> /dev/null; then
echo "Installing @openai/codex via npm..."
${pkgs.nodejs}/bin/npm i -g @openai/codex 2>/dev/null || true
fi
if ! command -v gemini &> /dev/null; then
echo "Installing @google/gemini-cli via npm..."
${pkgs.nodejs}/bin/npm i -g @google/gemini-cli 2>/dev/null || true
fi
'';
}

80
modules/user/shell.nix Normal file
View File

@@ -0,0 +1,80 @@
# ==========================================
# SHELL CONFIGURATION (Zsh)
# ==========================================
# Omarchy-style: Oh-My-Zsh + modern CLI replacements
# ==========================================
{ config, pkgs, ... }:
{
# Atuin — searchable shell history
programs.atuin = {
enable = true;
enableZshIntegration = true;
settings = {
auto_sync = false;
search_mode = "fuzzy";
};
};
# Zsh
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
# Rebuild shortcuts
upd = "cd ~/nixos-config && sudo nixos-rebuild switch --flake . && echo 'Done!'";
upd-test = "cd ~/nixos-config && sudo nixos-rebuild test --flake .";
upd-build = "cd ~/nixos-config && nixos-rebuild dry-build --flake .";
# Modern replacements
ls = "eza --icons";
ll = "eza -la --icons";
lt = "eza -la --icons --tree --level=2";
cat = "bat --style=plain";
find = "fd";
# Clipboard (Wayland)
pbcopy = "wl-copy";
pbpaste = "wl-paste";
# Docker
lzd = "lazydocker";
# Git
lg = "lazygit";
};
oh-my-zsh = {
enable = true;
theme = "gnzh";
plugins = [
"git"
"docker"
"docker-compose"
"eza"
"zoxide"
"colored-man-pages"
"fzf"
];
};
initContent = ''
# Force Atuin up-arrow binding
bindkey '^[[A' atuin-up-search
bindkey '^[OA' atuin-up-search
# Yazi wrapper cd on exit
function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
builtin cd -- "$cwd"
fi
rm -f -- "$tmp"
}
'';
};
}

34
modules/user/theming.nix Normal file
View File

@@ -0,0 +1,34 @@
# ==========================================
# THEMING CONFIGURATION — Gruvbox Dark
# ==========================================
# Omarchy philosophy: one theme, consistently applied
# across all applications and UI components.
# ==========================================
{ config, pkgs, ... }:
{
# GTK Dark Mode
gtk = {
enable = true;
theme = {
name = "Adwaita-dark";
package = pkgs.gnome-themes-extra;
};
gtk3.extraConfig.gtk-application-prefer-dark-theme = 1;
gtk4.extraConfig.gtk-application-prefer-dark-theme = 1;
};
# Qt Dark Mode
qt = {
enable = true;
platformTheme.name = "adwaita";
style.name = "adwaita-dark";
};
# Dark mode preference for GNOME/GTK apps
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
}