Compare commits

...

41 Commits

Author SHA1 Message Date
Martin Pander
0f2baf4651 Fix things 2026-02-06 23:06:49 +01:00
Martin Pander
744cb9eb0d Refactor nix config 2026-02-06 21:41:49 +01:00
Martin
8ca8d55826 [WIP] Refactor nix config 2026-02-06 20:51:39 +01:00
Martin Pander
f54655f3ae Add gc 2026-02-06 16:08:01 +01:00
Martin Pander
0e00b8811a Add nixos config 2026-02-06 15:23:14 +01:00
Martin Pander
802c215d71 Updates 2026-01-19 12:49:56 +01:00
Martin Pander
6eda68d8a4 Update flake; Fix Obsidian.nvim 2025-11-26 06:20:24 +01:00
Martin Pander
adb2595344 Things 2025-11-13 08:42:39 +01:00
Martin Pander
cc19b77b63 Update flake 2025-09-29 13:55:57 +02:00
Martin Pander
e00d798cfe Add lldb debug config 2025-07-25 11:14:39 +02:00
Martin Pander
d6311e5c1a Add copilot keymaps 2025-07-25 09:51:39 +02:00
Martin
285d23cd18 Add nvim copilot chat 2025-07-24 21:52:58 +02:00
Martin
b313e4516f Add nvim render markdown 2025-07-24 19:51:26 +02:00
Martin Pander
bd20986f0d Nvim 2025-07-24 12:15:43 +02:00
Martin
4cd09b24e1 Add relative line numbers 2025-07-22 20:33:19 +02:00
Martin Pander
1ef09c5115 Add lsp implementation 2025-07-22 08:12:43 +02:00
Martin Pander
a95ce2e095 Merge main 2025-07-22 08:09:53 +02:00
Martin
46b2c33e7b Merge main 2025-07-16 20:16:14 +02:00
Martin
0406542220 Merge main 2025-07-16 19:08:58 +02:00
Martin Pander
70c37da9ef nvim cmp priorities 2025-07-16 09:25:13 +02:00
Martin Pander
6a651c6a3d Fix wsl detection 2025-07-11 07:39:57 +02:00
Martin
606e5bed8e Sync config for all systems 2025-07-10 20:05:30 +02:00
Martin Pander
2d93535296 Add tmux displays 2025-07-10 14:05:58 +02:00
Martin Pander
d33e403915 Merge main; Move ft 2025-07-10 07:55:44 +02:00
Martin Pander
e0e6cb760e Plugins and things 2025-07-10 07:11:10 +02:00
Martin Pander
f4488f2469 Add debugging keymaps 2025-07-01 10:29:20 +02:00
Martin
c5f98b9238 Minor things 2025-06-26 16:04:04 +02:00
Martin Pander
c736ac9c64 Minor things 2025-06-25 15:37:06 +02:00
Martin Pander
9f75201e84 Merge dap config from main 2025-06-24 07:40:43 +02:00
Martin Pander
27643e0837 Update Obsidian config 2025-06-23 13:33:03 +02:00
Martin
90b2f80c83 Merge changes from main 2025-06-22 20:04:02 +02:00
Martin Pander
a4d57120bf Update nvim 2025-06-17 07:19:09 +02:00
Martin Pander
7de0c50a3a Update things 2025-04-28 13:55:41 +02:00
Martin Pander
05d3d997dc Merge branch 'nix' into nix-work 2025-02-27 12:09:55 +01:00
Martin Pander
b606d2a33d Add open command 2025-02-27 09:03:02 +01:00
Martin Pander
0e3e5077f3 Update versions 2024-12-04 07:22:37 +01:00
Martin Pander
f9ebfc652f Fix git lg 2024-10-22 12:06:09 +02:00
Martin Pander
f23c3d413b Add task reports; Add git diff setup 2024-09-23 08:25:51 +02:00
Martin Pander
85c6ae78fb Update shell and tasks 2024-05-17 14:18:57 +02:00
Martin Pander
6d106b954d Add zoxide 2024-04-26 15:03:58 +02:00
Martin Pander
d2763cfa8b Additions for work machine 2024-04-10 11:19:24 +02:00
54 changed files with 4435 additions and 124 deletions

206
MIGRATION.md Normal file
View File

@@ -0,0 +1,206 @@
# Migration Guide: Channels → Flakes
## Why Migrate to Flakes?
**Reproducibility**: Lock files pin exact package versions
**Latest unstable packages**: Easy access to nixos-unstable
**Better for dotfiles**: Version control with exact dependencies
**Modern approach**: Future of Nix configuration
**You're ready**: You already have flakes enabled!
## Current State (Channels)
Your current setup:
```bash
/etc/nixos/configuration.nix # Channel-based, imports from <nixos-wsl/modules>
```
Commands:
```bash
sudo nix-channel --update
sudo nixos-rebuild switch
```
## Target State (Flakes)
New setup:
```bash
/home/pan/dev/config/dot/nix/nixos/
├── flake.nix # Declares inputs (nixpkgs, nixos-wsl, home-manager)
├── configuration.nix # System config (no imports needed)
├── home.nix # Your user config
└── modules/ # User modules
```
Commands:
```bash
nix flake update # Update dependencies
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix
```
## Migration Steps
### Step 1: Test the Flake Configuration
First, let's make sure it builds without applying:
```bash
cd /home/pan/dev/config/dot/nix/nixos
nix flake check --impure # Validate syntax
sudo nixos-rebuild build --flake .#nix --impure # Test build
```
If successful, you'll see a `result` symlink. The `--impure` flag is needed for NIX_LD settings.
### Step 2: Review What Will Change
Compare your current and new configs:
```bash
diff /etc/nixos/configuration.nix /home/pan/dev/config/dot/nix/nixos/configuration.nix
```
Key differences:
- ❌ Removed: `imports = [ <nixos-wsl/modules> <home-manager/nixos> ]`
- ✅ Added: Flake manages these as inputs
- ✅ Uses: nixos-unstable (latest packages)
- ✅ Locks: Exact versions in flake.lock
### Step 3: Apply the Flake Configuration
**Option A: Direct (Recommended)**
```bash
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
```
**Option B: Symlink to /etc/nixos (Optional)**
```bash
sudo mv /etc/nixos/configuration.nix /etc/nixos/configuration.nix.backup
sudo ln -s /home/pan/dev/config/dot/nix/nixos/flake.nix /etc/nixos/flake.nix
sudo ln -s /home/pan/dev/config/dot/nix/nixos/configuration.nix /etc/nixos/configuration.nix
sudo nixos-rebuild switch --flake /etc/nixos#nix --impure
```
### Step 4: Verify Everything Works
After switching:
```bash
# Check system info
nixos-version
# Check flake info
nix flake metadata /home/pan/dev/config/dot/nix/nixos
# Test your tools
zsh --version
tmux -V
nvim --version
git --version
task --version
```
### Step 5: Set Up Convenient Alias (Optional)
Add to your shell config:
```bash
alias nixos-update='cd /home/pan/dev/config/dot/nix/nixos && nix flake update && sudo nixos-rebuild switch --flake .#nix --impure'
alias nixos-rebuild-switch='sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure'
```
## Rollback Plan
If anything goes wrong, you can always rollback:
```bash
# List generations
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
# Rollback to previous generation
sudo nixos-rebuild switch --rollback
# Or select from boot menu
# Reboot and choose previous generation
```
Your old channel-based config is still at `/etc/nixos/configuration.nix.backup`.
## Common Commands
### With Flakes
```bash
# Update all inputs (nixpkgs, home-manager, nixos-wsl)
nix flake update
# Update just one input
nix flake lock --update-input nixpkgs
# Apply configuration
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
# Test without applying
sudo nixos-rebuild build --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
# Check what changed
nix flake metadata /home/pan/dev/config/dot/nix/nixos
git diff flake.lock # See version changes
```
### Garbage Collection
```bash
# Delete old generations (save disk space)
sudo nix-collect-garbage --delete-older-than 30d
# Full cleanup
sudo nix-collect-garbage -d
sudo nix-store --optimise
```
## FAQ
### Do I need to remove channels?
No, but you can clean them up:
```bash
sudo nix-channel --list # See current channels
sudo nix-channel --remove nixos # Remove if desired
```
### Will my existing packages break?
No! The flake uses the same package set (nixos-unstable). Your home-manager config stays the same.
### What about `--impure` flag?
You need it because `home.nix` uses `NIX_LD` which reads from the store at evaluation time. This is fine and expected for this use case.
### Can I still use `nixos-rebuild switch` without flags?
Not directly with flakes. But you can:
1. Create an alias (see Step 5)
2. Symlink to `/etc/nixos/flake.nix` and use `--flake /etc/nixos#nix`
### How do I update packages now?
```bash
# Update flake.lock to latest versions
nix flake update
# Then rebuild
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
```
## Benefits You'll Get
1. **Exact versions**: `flake.lock` pins everything
2. **Faster updates**: Only download what changed
3. **Better caching**: Flakes have better binary cache hits
4. **Git-friendly**: Your whole system in version control
5. **Easy sharing**: Others can reproduce your exact system
## Next Steps After Migration
1. ✅ Commit your configuration to git
2. ✅ Remove old channels (optional)
3. ✅ Set up shell aliases
4. ✅ Enjoy reproducible configs! 🎉

107
QUICK_START.md Normal file
View File

@@ -0,0 +1,107 @@
# Quick Start Guide
## TL;DR - Should I Use Flakes?
**YES!** ✅ Use flakes because:
1. You get **nixos-unstable** (latest packages) with reproducibility
2. Your config is in **git** with locked versions (flake.lock)
3. You **already have flakes enabled** in your system
4. It's the **modern, recommended approach**
## Current vs Flake Setup
### Current (Channels) ❌
```bash
# Update
sudo nix-channel --update
sudo nixos-rebuild switch
# Config location
/etc/nixos/configuration.nix
# Package versions
Whatever the channel has (not locked)
```
### With Flakes (Recommended) ✅
```bash
# Update
nix flake update
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
# Config location
/home/pan/dev/config/dot/nix/nixos/
├── flake.nix (inputs: nixpkgs unstable, home-manager, nixos-wsl)
├── flake.lock (exact versions locked)
└── configuration.nix
# Package versions
Locked in flake.lock, reproducible everywhere
```
## Apply the Flake Configuration Now
### Step 1: Test it
```bash
cd /home/pan/dev/config/dot/nix/nixos
nix flake check --impure
sudo nixos-rebuild build --flake .#nix --impure
```
### Step 2: If successful, apply it
```bash
sudo nixos-rebuild switch --flake .#nix --impure
```
### Step 3: Verify
```bash
nixos-version
nix flake metadata /home/pan/dev/config/dot/nix/nixos
```
## What Changes?
- ✅ Same packages, just from nixos-unstable (usually newer)
- ✅ Same home-manager config (all your dotfiles stay)
- ✅ Same NixOS-WSL functionality
- ✅ Exact versions locked in flake.lock
- ✅ Easy to rollback (NixOS generations)
## Daily Usage
```bash
# Make config changes
vim /home/pan/dev/config/dot/nix/nixos/home.nix
# Apply
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
# Update packages (weekly/monthly)
cd /home/pan/dev/config/dot/nix/nixos
nix flake update
sudo nixos-rebuild switch --flake .#nix --impure
# Rollback if needed
sudo nixos-rebuild switch --rollback
```
## Create Convenience Alias
Add to your `~/.zshrc` or shell config:
```bash
# Quick rebuild
alias nr='sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure'
# Update and rebuild
alias nu='cd /home/pan/dev/config/dot/nix/nixos && nix flake update && sudo nixos-rebuild switch --flake .#nix --impure'
```
Then just run `nr` to rebuild!
## Need Help?
- Read [MIGRATION.md](MIGRATION.md) for detailed migration guide
- Read [README.md](README.md) for full documentation
- Check [TODO.md](TODO.md) for known issues

282
README.md Normal file
View File

@@ -0,0 +1,282 @@
# NixOS-WSL Configuration for pan
This is a flake-based NixOS-WSL configuration ported from the standalone Home Manager setup. It provides a declarative, reproducible system configuration with integrated Home Manager and access to the latest unstable packages.
## Structure
```
nixos/
├── flake.nix # Flake with nixos-unstable, nixos-wsl, home-manager
├── flake.lock # Locked dependency versions (auto-generated)
├── configuration.nix # System-level NixOS-WSL configuration
├── home.nix # Home Manager user configuration
├── modules/ # User-level module configurations
│ ├── sh.nix # Shell (Zsh with Prezto, fzf, zoxide)
│ ├── tmux.nix # Tmux configuration
│ ├── git.nix # Git, Lazygit, Jujutsu
│ ├── nvim.nix # Neovim with 40+ plugins
│ ├── dev.nix # Development tools
│ └── task.nix # Taskwarrior, Timewarrior
├── README.md # This file
├── TODO.md # Known issues and future work
├── SUMMARY.md # Implementation overview
└── MIGRATION.md # Guide for migrating from channels to flakes
```
## Installation
### 1. Test the Configuration (Recommended First Step)
Before applying, validate and test build:
```bash
cd /home/pan/dev/config/dot/nix/nixos
# Validate flake syntax
nix flake check --impure
# Test build without activating
sudo nixos-rebuild build --flake .#nix --impure
```
The `--impure` flag is needed for NIX_LD settings in the home configuration.
### 2. Customize Configuration (Optional)
Edit `configuration.nix` to adjust:
- **Hostname**: Change `networking.hostName` (current: "nix")
- **Timezone**: Change `time.timeZone` (current: "Europe/Berlin")
- **WSL user**: Change `wsl.defaultUser` (current: "pan")
The current settings should work for your NixOS-WSL setup.
### 3. Apply Configuration
Apply the flake configuration:
```bash
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
```
Or from inside the directory:
```bash
cd /home/pan/dev/config/dot/nix/nixos
sudo nixos-rebuild switch --flake .#nix --impure
```
### 4. Verify Installation
After applying, verify everything works:
```bash
# Check system
nixos-version
# Check flake info
nix flake metadata /home/pan/dev/config/dot/nix/nixos
# Test your tools
zsh --version
tmux -V
nvim --version
```
## Updating the Configuration
After making changes to any configuration file:
```bash
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
```
## Updating System Packages
To update all packages to the latest versions from nixos-unstable:
```bash
cd /home/pan/dev/config/dot/nix/nixos
# Update flake inputs (nixpkgs, home-manager, nixos-wsl)
nix flake update
# Apply the updates
sudo nixos-rebuild switch --flake .#nix --impure
```
View what changed:
```bash
git diff flake.lock # See version bumps
```
## Rollback
### Rollback to Previous Generation
If something breaks after an update:
```bash
sudo nixos-rebuild switch --rollback
```
### List All Generations
```bash
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
```
### Switch to Specific Generation
```bash
sudo nixos-rebuild switch --switch-generation <number>
```
### Rollback from Boot Menu
At boot time, select "NixOS - All configurations" to see all previous generations and boot into any of them.
## Differences from Original Ubuntu Configuration
### Removed Features
- **macOS/Darwin support**: All nix-darwin references removed
- **WSL-specific paths**: Hard-coded Windows paths in tmux configuration removed
- **Platform conditionals**: Darwin and Windows checks cleaned up
### System-Level Changes
- **User management**: User `pan` is now defined at the system level
- **Boot configuration**: Bootloader settings added
- **Networking**: NetworkManager enabled for network management
- **Zsh**: Enabled system-wide (configured via Home Manager)
### Custom Packages Status
The following custom packages from the original configuration are currently commented out in `modules/dev.nix`:
- `claude-code`
- `opencode`
- `gemini-cli`
See [TODO.md](TODO.md) for information on integrating these packages.
## Verification After Installation
### Test Shell Environment
```bash
# Verify zsh is running
echo $SHELL
# Test fzf (Ctrl+R for history search)
# Test zoxide
z /path/to/directory
# Test lsd, bat
lsd
bat some-file
```
### Test Tmux
```bash
# Start tmux
tmux new -s test
# Test custom keybindings:
# Alt+L/H - Next/previous window
# Alt+J/K - Next/previous session
# Ctrl+a + Ctrl+g - Lazygit popup
```
### Test Neovim
```bash
nvim test.nix
# Inside nvim:
# :LspInfo - Check LSP status
# :checkhealth - Check overall health
```
### Test Git & VCS
```bash
git config --get user.name # Should be "Martin Pander"
git config --get user.email # Should be "martin.pander@knowtion.de"
lazygit --version
jj --version
```
### Test Taskwarrior
```bash
task --version # Should be 3.x
tt # taskwarrior-tui
timew --version
```
### Test Development Tools
```bash
direnv --version
visidata --version
```
## Common Tasks
### Add a New Package
Edit `home.nix` or the appropriate module file, then rebuild:
```bash
sudo nixos-rebuild switch --flake .#nixos
```
### Enable a System Service
Edit `configuration.nix` to add the service, then rebuild:
```bash
sudo nixos-rebuild switch --flake .#nixos
```
### Cleanup Old Generations
Remove old generations to free up disk space:
```bash
# Delete generations older than 30 days
sudo nix-collect-garbage --delete-older-than 30d
# Or delete all old generations except current
sudo nix-collect-garbage -d
```
## Troubleshooting
### Build Fails
Check for syntax errors:
```bash
nix flake check
```
### Services Don't Start
Check service status:
```bash
systemctl status <service-name>
journalctl -u <service-name>
```
### Home Manager Issues
Rebuild Home Manager separately:
```bash
home-manager switch --flake .#pan
```
### NIX_LD Issues
If you encounter issues running non-Nix binaries, check that NIX_LD variables are set:
```bash
echo $NIX_LD
echo $NIX_LD_LIBRARY_PATH
```
## Resources
- [NixOS Manual](https://nixos.org/manual/nixos/stable/)
- [Home Manager Manual](https://nix-community.github.io/home-manager/)
- [Nixpkgs Search](https://search.nixos.org/packages)
- [NixOS Discourse](https://discourse.nixos.org/)
## Support
For issues specific to this configuration, see the TODO.md file for known limitations and planned improvements.

180
SUMMARY.md Normal file
View File

@@ -0,0 +1,180 @@
# NixOS Configuration - Implementation Summary
This document summarizes the NixOS configuration that was created based on the migration plan.
## What Was Created
### Directory Structure
```
nixos/
├── flake.nix # NixOS flake (no nix-darwin)
├── flake.lock # Flake lockfile (auto-generated)
├── configuration.nix # System-level configuration
├── hardware-configuration.nix # Hardware template (MUST be replaced)
├── home.nix # Home Manager integration
├── modules/ # User-level configurations
│ ├── sh.nix # Shell (Zsh, Prezto, fzf, zoxide)
│ ├── tmux.nix # Tmux (WSL paths removed)
│ ├── git.nix # Git, Lazygit, Jujutsu
│ ├── nvim.nix # Neovim with 40+ plugins
│ ├── dev.nix # Dev tools (direnv, visidata)
│ └── task.nix # Taskwarrior, Timewarrior
├── README.md # Installation and usage guide
├── TODO.md # Remaining tasks and issues
└── SUMMARY.md # This file
```
## Key Changes from Original Configuration
### ✅ Removed
- **nix-darwin** input and outputs
- **macOS/Darwin** conditionals (lines 54-58 in sh.nix)
- **WSL** hard-coded paths (lines 31-32 in tmux.nix)
- **Windows** checks (lines 115-117 in sh.nix)
### ✅ Added
- **System-level configuration** (configuration.nix)
- Boot loader setup (systemd-boot)
- Networking with NetworkManager
- User account definition
- System timezone and locale
- Nix flakes enabled
- **Hardware configuration template** (hardware-configuration.nix)
- Placeholder for NixOS-generated config
- Must be replaced during installation
### ✅ Modified
- **Home Manager integration**
- Now runs as NixOS module (not standalone)
- useGlobalPkgs enabled
- Removed allowUnfree (handled at system level)
- **Shell configuration** (modules/sh.nix)
- Removed all platform-specific conditionals
- Clean Linux-only configuration
- Added `profileExtra` for .profile sourcing
- **Tmux configuration** (modules/tmux.nix)
- Commented out note keybindings (C-n, C-p)
- Paths need to be updated for NixOS environment
- **Development tools** (modules/dev.nix)
- Custom packages commented out:
- claude-code
- opencode
- gemini-cli
- TODO notes added for integration
## Validation Status
✅ Flake syntax is valid
✅ Configuration evaluates successfully
✅ All module imports resolve correctly
✅ No blocking errors found
⚠️ Requires `--impure` flag due to NIX_LD settings
## What Needs to Be Done Before Use
### 🔴 Critical (Must Do)
1. **Replace hardware-configuration.nix**
```bash
sudo nixos-generate-config --show-hardware-config > nixos/hardware-configuration.nix
```
2. **Update hostname** in configuration.nix
- Currently set to: "nixos"
- Change to your actual hostname
3. **Verify boot loader** choice in configuration.nix
- UEFI: systemd-boot (currently enabled)
- BIOS: GRUB (commented out)
### 🟡 Important (Should Do)
1. **Verify timezone** in configuration.nix
- Currently: "Europe/Berlin"
2. **Check locale settings** in configuration.nix
- Currently: en_US.UTF-8 / de_DE.UTF-8
3. **Verify nvim lua files** exist at:
- `/home/pan/dev/config/dot/nvim/base.lua`
- `/home/pan/dev/config/dot/nvim/keymaps.lua`
- `/home/pan/dev/config/dot/nvim/plugins.lua`
- `/home/pan/dev/config/dot/nvim/filetype.lua`
### 🟢 Optional (Nice to Have)
1. **Update tmux note paths** in modules/tmux.nix (C-n, C-p keybindings)
2. **Add custom packages** (claude-code, opencode, gemini-cli)
3. **Review and customize** any other settings
## How to Apply
### Test Build (Recommended First)
```bash
cd /home/pan/dev/config/dot/nix/nixos
sudo nixos-rebuild build --flake .#nixos --impure
```
### Apply Configuration
```bash
cd /home/pan/dev/config/dot/nix/nixos
sudo nixos-rebuild switch --flake .#nixos --impure
```
### Update Packages
```bash
nix flake update
sudo nixos-rebuild switch --flake .#nixos --impure
```
## Verification Checklist
After applying the configuration, verify:
- [ ] System boots successfully
- [ ] User 'pan' can login
- [ ] Zsh loads with Prezto theme
- [ ] fzf keybindings work (Ctrl+R)
- [ ] zoxide works (`cd` command)
- [ ] Tmux starts without errors
- [ ] Neovim opens with all plugins
- [ ] Git config shows correct user
- [ ] Lazygit and Jujutsu work
- [ ] Taskwarrior shows version 3.x
- [ ] Direnv loads .envrc files
## Files Preserved
The original Home Manager configuration remains untouched:
- `/home/pan/dev/config/dot/nix/flake.nix`
- `/home/pan/dev/config/dot/nix/common.nix`
- `/home/pan/dev/config/dot/nix/user/*`
You can continue using the Ubuntu setup alongside this NixOS configuration.
## Documentation
- **README.md**: Complete installation and usage guide
- **TODO.md**: Detailed list of remaining tasks and known issues
- **SUMMARY.md**: This file - quick overview and status
## Support
For issues or questions:
1. Check TODO.md for known issues
2. Review README.md for troubleshooting
3. Consult NixOS manual: https://nixos.org/manual/nixos/stable/
## Next Steps
1. ✅ Configuration created successfully
2. ⏳ Replace hardware-configuration.nix
3. ⏳ Update hostname and timezone
4. ⏳ Test build configuration
5. ⏳ Apply configuration
6. ⏳ Verify all components work
Good luck with your NixOS migration! 🚀

173
TODO.md Normal file
View File

@@ -0,0 +1,173 @@
# TODO - NixOS Configuration
This file tracks remaining tasks and known issues for the NixOS configuration.
## High Priority
### Hardware Configuration
- [ ] Replace `hardware-configuration.nix` with actual generated configuration
- Run `sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix`
- Verify file systems are correctly configured
- Verify boot partition is correct
- Adjust CPU microcode (Intel vs AMD)
### System Settings
- [ ] Set correct hostname in `configuration.nix`
- [ ] Verify timezone setting (currently: Europe/Berlin)
- [ ] Verify locale settings (currently: en_US.UTF-8 / de_DE.UTF-8)
- [ ] Choose boot loader (systemd-boot vs GRUB)
## Medium Priority
### Custom Packages
The following packages need to be integrated or replaced:
- [ ] **claude-code**
- Check if available in nixpkgs
- If custom: create derivation in `packages/claude-code.nix`
- Or use alternative package manager (npm, pip, cargo)
- [ ] **opencode**
- Check if available in nixpkgs
- If custom: create derivation in `packages/opencode.nix`
- Or use alternative package manager
- [ ] **gemini-cli**
- Check if available in nixpkgs
- If custom: create derivation in `packages/gemini-cli.nix`
- Or use alternative package manager
### Tmux Configuration
- [ ] Update note popup keybindings (C-n, C-p) with correct NixOS paths
- Current: Commented out (had WSL hard-coded paths)
- Action: Decide on note location and update paths
- Example: `~/Documents/notes/Work/quick_notes.md`
- [ ] Verify `~/bin/tmuxp_selector.sh` script exists
- Used by `C-s` keybinding
- May need to be created or path adjusted
## Low Priority
### Shell Configuration
- [ ] Consider adding additional shell aliases
- [ ] Review if any macOS-specific tools need Linux alternatives
- [ ] Consider adding dircolors configuration
### Documentation
- [ ] Add screenshots of tmux setup
- [ ] Document custom Neovim configuration (lua files)
- [ ] Create troubleshooting guide for common issues
### Optimizations
- [ ] Consider using `programs.zsh.shellInit` vs `initContent`
- [ ] Review if `nix-ld` is actually needed (check use cases)
- [ ] Consider splitting large modules into smaller files
## Features Not Yet Ported
These were not in the original Home Manager config but might be useful on NixOS:
- [ ] Desktop environment / Window manager
- [ ] Display manager (GDM, SDDM, LightDM)
- [ ] Sound configuration (PipeWire/PulseAudio)
- [ ] Printing support
- [ ] Bluetooth support
- [ ] Docker / Podman
- [ ] Virtualization (QEMU/KVM)
## Known Issues
### Nvim Configuration Files
The nvim configuration references lua files from the parent directory:
```nix
initLua = builtins.concatStringsSep "\n" [
(lib.strings.fileContents ../../../nvim/base.lua)
(lib.strings.fileContents ../../../nvim/keymaps.lua)
(lib.strings.fileContents ../../../nvim/plugins.lua)
(lib.strings.fileContents ../../../nvim/filetype.lua)
];
```
**Status**: Should work if nvim/ directory exists at `/home/pan/dev/config/dot/nvim/`
**Action**: Verify these files exist or adjust paths
### Profile Loading
The shell configuration includes:
```nix
profileExtra = ''
source $HOME/.profile
'';
```
**Status**: Will fail silently if `~/.profile` doesn't exist
**Action**: Either create `~/.profile` or remove this line if not needed
## Testing Checklist
Before considering this configuration complete:
- [ ] System boots successfully
- [ ] User can login as `pan`
- [ ] Zsh loads with Prezto
- [ ] Tmux starts without errors
- [ ] Neovim opens and plugins load
- [ ] LSP servers work in Neovim
- [ ] Git commands work with correct identity
- [ ] Lazygit opens and works
- [ ] Jujutsu commands work
- [ ] Taskwarrior shows tasks
- [ ] Direnv loads `.envrc` files
- [ ] fzf keybindings work (Ctrl+R)
- [ ] zoxide navigation works
- [ ] All shell aliases work
## Future Enhancements
- [ ] Add backup/restore scripts
- [ ] Create CI/CD for testing configuration
- [ ] Add secrets management (agenix or sops-nix)
- [ ] Consider using flake-parts for better organization
- [ ] Add system monitoring tools
- [ ] Configure automatic updates
- [ ] Add custom shell functions
- [ ] Integrate with cloud sync for dotfiles
## Notes
### Differences from Ubuntu Setup
1. **No macOS support**: All Darwin-specific code removed
2. **No WSL support**: WSL-specific paths and checks removed
3. **System-level user**: User defined in NixOS config, not standalone
4. **Integrated Home Manager**: HM runs as NixOS module, not standalone
### Migration Path
If migrating from existing Ubuntu setup:
1. Backup current configuration
2. Install NixOS (keep Ubuntu if dual-boot)
3. Apply this configuration
4. Test all workflows
5. Import personal data (tasks, notes, etc.)
6. Verify custom packages availability
## Questions to Resolve
- [ ] What are the custom packages used for?
- [ ] Are there any private/work-specific configurations to add?
- [ ] Should we add any of the "Features Not Yet Ported"?
- [ ] Is GPU acceleration needed (NVIDIA, AMD)?
- [ ] Are there any cron jobs or systemd timers to configure?
- [ ] Should we enable fish or keep only zsh?
- [ ] Do we need any container tools (Docker, Podman)?

107
newnix/flake.lock generated Normal file
View File

@@ -0,0 +1,107 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1770318660,
"narHash": "sha256-yFVde8QZK7Dc0Xa8eQDsmxLX4NJNfL1NKfctSyiQgMY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "471e6a065f9efed51488d7c51a9abbd387df91b8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1770184146,
"narHash": "sha256-DsqnN6LvXmohTRaal7tVZO/AKBuZ02kPBiZKSU4qa/k=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "0d7874ef7e3ba02d58bebb871e6e29da36fa1b37",
"type": "github"
},
"original": {
"owner": "LnL7",
"repo": "nix-darwin",
"type": "github"
}
},
"nixos-wsl": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1769217863,
"narHash": "sha256-RY9kJDXD6+2Td/59LkZ0PFSereCXHdBX9wIkbYjRKCY=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "38a5250e57f583662eac3b944830e4b9e169e965",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NixOS-WSL",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1770197578,
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

90
newnix/flake.nix Normal file
View File

@@ -0,0 +1,90 @@
{
description = "Unified Nix Configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixos-wsl, home-manager, nix-darwin, ... }@inputs:
let
linuxSystem = "x86_64-linux";
linuxAarchSystem = "aarch64-linux";
darwinSystem = "aarch64-darwin";
pkgsLinux = nixpkgs.legacyPackages.${linuxSystem};
pkgsLinuxAarch = nixpkgs.legacyPackages.${linuxAarchSystem};
pkgsDarwin = nixpkgs.legacyPackages.${darwinSystem};
in
{
# --- NixOS Systems ---
nixosConfigurations = {
# Work WSL
work = nixpkgs.lib.nixosSystem {
system = linuxSystem;
specialArgs = { inherit self; };
modules = [
nixos-wsl.nixosModules.wsl
./hosts/work/nixos/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.pan = import ./hosts/work/nixos/home.nix;
}
];
};
# Home
home = nixpkgs.lib.nixosSystem {
system = linuxAarchSystem;
specialArgs = { inherit self; };
modules = [
./hosts/home/nixos/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.martin = import ./hosts/home/nixos/home.nix;
}
];
};
};
# --- Darwin Systems (Mac) ---
darwinConfigurations."Martins-MacBook-Pro" = nix-darwin.lib.darwinSystem {
system = darwinSystem;
specialArgs = { inherit self; };
modules = [ ./hosts/home/darwin/configuration.nix ];
};
# --- Standalone Home Manager ---
homeConfigurations = {
"pan@work" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsLinux;
modules = [ ./hosts/work/nix/home.nix ];
};
"martin@mac" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsDarwin;
modules = [ ./hosts/home/nix/home.nix ];
};
};
};
}

View File

@@ -0,0 +1,19 @@
{ config, pkgs, self, ... }:
{
# Minimal system configuration
environment.systemPackages = [ pkgs.vim ];
services.nix-daemon.enable = true;
nix.settings.experimental-features = "nix-command flakes";
programs.zsh.enable = true;
# Set Git commit hash for darwin-version.
system.configurationRevision = self.rev or self.dirtyRev or null;
system.stateVersion = 4;
nixpkgs.hostPlatform = "aarch64-darwin";
}

View File

@@ -0,0 +1,22 @@
{ config, pkgs, ... }:
{
imports = [
../../../modules/home/common.nix
];
home.username = "martin";
home.homeDirectory = "/Users/martin";
home.stateVersion = "24.05";
programs.git.settings.user = {
name = "Martin Pander";
email = "git@pander-on.de";
};
programs.jujutsu.settings.user = {
name = "Martin Pander";
email = "git@pander-on.de";
};
}

View File

@@ -0,0 +1,28 @@
{ config, lib, pkgs, ... }:
{
imports = [
../../../modules/nixos/common.nix
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
networking.hostName = "macnix";
users.users.martin = {
isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" ];
uid = 1000;
shell = pkgs.zsh;
};
services.openssh.enable = true;
system.stateVersion = "25.11";
}

View File

@@ -0,0 +1,13 @@
{ config, pkgs, lib, ... }:
{
imports = [
../../../modules/home/common.nix
];
# User details
home.username = "martin";
home.homeDirectory = "/home/martin";
home.stateVersion = "25.11";
}

View File

@@ -0,0 +1,28 @@
{ config, pkgs, ... }:
{
imports = [
../../../modules/home/common.nix
../../../modules/home/llm.nix
];
home.username = "pan";
home.homeDirectory = "/home/pan";
home.stateVersion = "23.11";
programs.git.settings.user = {
name = "Martin Pander";
email = "martin.pander@knowtion.de";
};
programs.jujutsu.settings.user = {
name = "Martin Pander";
email = "martin.pander@knowtion.de";
};
programs.zsh.profileExtra = ''
source $HOME/.profile
'';
}

View File

@@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
{
imports = [
../../../modules/nixos/common.nix
];
wsl.enable = true;
wsl.defaultUser = "pan";
wsl.interop.register = true;
networking.hostName = "nix";
users.users.pan = {
isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" ];
uid = 1000;
shell = pkgs.zsh;
};
system.stateVersion = "25.05";
}

View File

@@ -0,0 +1,31 @@
{ config, pkgs, lib, ... }:
{
imports = [
../../../modules/home/common.nix
];
# User details
home.username = "pan";
home.homeDirectory = "/home/pan";
# Git and Jujutsu user configuration
programs.git.settings.user = {
name = "Martin Pander";
email = "martin.pander@knowtion.de";
};
programs.jujutsu.settings.user = {
name = "Martin Pander";
email = "martin.pander@knowtion.de";
};
home.packages = with pkgs; [
nix-ld
];
# This value determines the Home Manager release which the configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
home.stateVersion = "25.05";
}

View File

@@ -0,0 +1,26 @@
{ config, pkgs, lib, ... }:
{
imports = [
./sh.nix
./tmux.nix
./git.nix
./dev.nix
./nvim.nix
./task.nix
];
home.packages = with pkgs; [
nil # Nix LSP
nerd-fonts.fira-code
# Language servers
yaml-language-server
marksman
dockerfile-language-server
];
news.display = "silent";
programs.home-manager.enable = true;
}

View File

@@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
home.packages = with pkgs; [
visidata
];
}

View File

@@ -0,0 +1,88 @@
{ config, pkgs, ... }:
{
programs.git = {
enable = true;
settings = {
alias = {
st = "status";
ci = "commit";
co = "checkout";
br = "branch";
pl = "pull";
ps = "push";
sw = "switch";
mno =" merge --no-ff";
lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit";
cleanup = "!git fetch --prune && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D";
};
column.ui = "auto";
branch.sort = "-committerdate";
tag.sort = "version:refname";
diff = {
algorithm = "histogram";
colorMoved = "plain";
mnemonicPrefix = "true";
renames = "true";
};
pull.rebase = "true";
push = {
default = "simple";
autoSetupRemote = "true";
followTags = "true";
};
fetch = {
prune = "true";
pruneTags = "true";
all = "true";
};
help.autocorrect = "prompt";
commit.verbose = "true";
rerere = {
enabled = "true";
autoupdate = "true";
};
rebase = {
autoSquas = "true";
autoStash = "true";
updateRefs = "true";
};
merge.conflictstyle = "zdiff3";
core.editor = "nvim";
init.defaultBranch = "main";
};
ignores = [
".direnv/"
".envrc"
];
};
programs.difftastic = {
enable = true;
git.enable = true;
};
programs.lazygit = {
enable = true;
settings = {
theme.lightTheme = "true";
git = {
log = {
format = "%C(yellow)%h%Creset %C(bold blue)<%an>%Creset %s %Cgreen(%cr)%Creset";
graph = "true";
};
};
};
};
programs.jujutsu = {
enable = true;
settings = {
aliases = {
tug = ["bookmark" "move" "--from" "heads(::@- & bookmarks())" "--to" "@-"];
};
};
};
}

View File

@@ -0,0 +1,10 @@
{ config, pkgs, ... }:
{
home.packages = with pkgs; [
bubblewrap
claude-code
opencode
gemini-cli
];
}

View File

@@ -0,0 +1,85 @@
{ config, pkgs, lib, ... }:
{
programs.neovim = {
enable = true;
defaultEditor = true;
vimAlias = true;
plugins = with pkgs.vimPlugins; [
vim-repeat
vim-surround
ts-comments-nvim
vim-fugitive
gitsigns-nvim
nvim-tree-lua
targets-vim
mini-pairs
mini-align
mini-bracketed
mini-splitjoin
mini-move
mini-ai
mini-icons
flash-nvim
trouble-nvim
conform-nvim
nvim-lint
promise-async
nvim-ufo
vim-windowswap
plenary-nvim
telescope-nvim
telescope-fzf-native-nvim
telescope-ui-select-nvim
yanky-nvim
lualine-nvim
undotree
luasnip
nvim-cmp
cmp_luasnip
cmp-buffer
cmp-path
cmp-cmdline
cmp-nvim-lsp
cmp-nvim-lsp-signature-help
cmp_yanky
cmp-git
nvim-lspconfig
lspkind-nvim
copilot-lua
copilot-cmp
CopilotChat-nvim
bullets-vim
nvim-dap
nvim-nio
nvim-dap-ui
nvim-dap-virtual-text
nvim-dap-go
nvim-dap-python
nvim-dap-lldb
todo-comments-nvim
vim-markdown
zen-mode-nvim
plantuml-syntax
obsidian-nvim
render-markdown-nvim
image-nvim
img-clip-nvim
vim-nix
(nvim-treesitter.withPlugins (p: [ p.awk p.bash p.c p.c_sharp p.cpp p.css p.diff p.dockerfile p.doxygen p.git_config p.gitcommit p.go p.gomod p.gosum p.gotmpl p.helm p.haskell p.html p.http p.java p.javascript p.json p.latex p.lua p.markdown p.markdown_inline p.matlab p.nix p.printf p.python p.regex p.rust p.sql p.strace p.supercollider p.svelte p.swift p.terraform p.tmux p.toml p.typescript p.vim p.xml p.yaml p.zig ]))
];
initLua = builtins.concatStringsSep "\n" [
(lib.strings.fileContents ../../../nvim/base.lua)
(lib.strings.fileContents ../../../nvim/keymaps.lua)
(lib.strings.fileContents ../../../nvim/plugins.lua)
(lib.strings.fileContents ../../../nvim/filetype.lua)
];
};
home.packages = with pkgs; [
nodejs-slim
];
}

View File

@@ -0,0 +1,99 @@
{ config, pkgs, lib, ... }:
{
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
history.size = 500000;
prezto = {
enable = true;
caseSensitive = true;
color = true;
editor = {
dotExpansion = true;
keymap = "vi";
};
pmodules = [
"environment"
"terminal"
"editor"
"history"
"directory"
"spectrum"
"utility"
"completion"
"syntax-highlighting"
"history-substring-search"
"prompt"
"git"
];
prompt.theme = "minimal";
syntaxHighlighting.highlighters = [
"main"
"brackets"
"pattern"
"line"
"cursor"
"root"
];
tmux = {
autoStartLocal = true;
itermIntegration = true;
};
};
initContent = ''
HISTCONTROL='erasedups:ignoreboth'
HISTIGNORE='&:[ ]*:exit:ls:bg:fg:history:clear'
unsetopt beep
'';
profileExtra = ''
source $HOME/.profile
'';
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.lsd = {
enable = true;
enableZshIntegration = true;
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
options = [
"--cmd cd"
];
};
programs.bat.enable = true;
programs.ripgrep.enable = true;
programs.btop.enable = true;
programs.ranger.enable = true;
home.packages = with pkgs; [
fd
dust
glow
ripgrep-all
viddy
duf
];
home.sessionVariables = {
BAT_THEME = "Coldark-Cold";
};
home.shellAliases = {
lst = "lsd --tree";
};
}

View File

@@ -0,0 +1,75 @@
{config, pkgs, lib, ...}:
{
programs.taskwarrior = {
enable = true;
colorTheme = "light-256";
package = pkgs.taskwarrior3;
config = {
weekstart = "monday";
uda.tasksquire.tags.default="code,comm,cust,del,doc,mngmnt,ops,rsrch,rvw,track";
uda.parenttask.type="string";
uda.parenttask.label="Parent";
uda.energy.type="string";
uda.energy.label="Energy";
uda.energy.values="h,m,l";
uda.energy.default="m";
uda.priority.values = "H,M,,L";
urgency.uda.priority.L.coefficient = -0.5;
urgency.user.tag.deferred.coefficient = -15.0;
urgency.user.tag.cust.coefficient = 5.0;
urgency.user.tag.fixed.coefficient = -100.0;
report.next.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.next.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.next.filter="status:pending -WAITING -deferred -track";
report.time.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.time.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.time.filter="status:pending -WAITING -deferred +fixed";
report.deferred.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.deferred.context="1";
report.deferred.description="Deferred and waiting tasks";
report.deferred.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.deferred.filter="status:pending +deferred";
report.deferred.sort="urgency-";
report.low.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.low.context="1";
report.low.description="Low energy tasks";
report.low.filter="status:pending -WAITING -deferred";
report.low.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.low.sort="energy+,urgency-";
context.today.read = "(prio:H or +next)";
context.today.write = "prio:H +next";
context.deferred.read = "+deferred";
context.deferred.write = "+deferred";
context.customer.read = "+cust";
context.customer.write = "+cust";
context.low_energy.read = "+low";
context.low_energy.write = "+low";
uda.taskwarrior-tui.task-report.show-info = false;
uda.taskwarrior-tui.selection.reverse = "yes";
};
};
home.packages = with pkgs; [
taskwarrior-tui
timewarrior
];
home.shellAliases = lib.mkMerge [ {
t = "task";
tt = "taskwarrior-tui";
tw = "timew";
tws = "timew summary :ids";
}
];
}

View File

@@ -0,0 +1,73 @@
{ config, pkgs, lib, ... }:
{
programs.tmux = {
enable = true;
shortcut = "a";
mouse = true;
keyMode = "vi";
escapeTime = 0;
terminal = "screen-256color";
tmuxp.enable = true;
extraConfig = ''
set -g display-time 1500
unbind S
bind S command-prompt "switch -t %1"
bind-key -n M-K switch-client -p
bind-key -n M-J switch-client -n
bind-key -n M-L next-window
bind-key -n M-H previous-window
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -a -c "#{pane_current_path}"
bind C-s display-popup -E "zsh ~/bin/tmuxp_selector.sh"
bind C-g display-popup -E -d "#{pane_current_path}" -xC -yC -w 95% -h 95% "lazygit"
bind C-t display-popup -E -xC -yC -w 95% -h 95% "tasksquire"
# Note: The following keybindings had hard-coded WSL paths that were removed.
# Adjust the paths below to match your NixOS environment:
# bind C-n display-popup -E -xC -yC -w 95% -h 95% -d "~/Documents/notes/Work/" "vim quick_notes.md"
# bind C-p display-popup -E -xC -yC -w 95% -h 95% -d "~/Documents/notes/Work/development/" "vim mbpr.md"
#######################################
# status line
#######################################
set -g status-justify centre
set -g status-left "#[bg=#808080,fg=#ffffff,bold] #S #[default]#[bg=#BCBCBC] #{-30:pane_title} "
set -g status-left-length 40
set -g status-right "#[bg=#BCBCBC] %H:%M #[bg=#808080,fg=#ffffff] %d.%m.%y "
# setw -g window-status-format " #W#F "
# setw -g window-status-current-format " #W#F "
setw -g window-status-format " #W "
setw -g window-status-current-format " #W "
setw -g window-status-separator ""
#######################################
# colors, taken from vim-lucius
#######################################
set -g status-style "bg=#DADADA,fg=#000000"
setw -g window-status-style "bg=#BCBCBC,fg=#000000"
setw -g window-status-current-style "bg=#808080,fg=#ffffff"
setw -g window-status-activity-style "bg=#AFD7AF,fg=#000000"
setw -g window-status-bell-style "bg=#AFD7AF,fg=#000000"
#setw -g window-status-content-style "bg=#AFD7AF,fg=#000000"
set -g pane-active-border-style "bg=#eeeeee,fg=#006699"
set -g pane-border-style "bg=#eeeeee,fg=#999999"
'';
};
home.shellAliases = {
"o" = "tmuxp";
"ol" = "tmuxp load";
};
}

View File

@@ -0,0 +1,40 @@
{ config, pkgs, lib, ... }:
{
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
programs.zsh.enable = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
nixpkgs.config.allowUnfree = true;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
environment.systemPackages = with pkgs; [
git
wget
curl
vim
];
}

View File

@@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
{ {
imports = [ imports = [
@@ -16,6 +16,8 @@
# (pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }) # (pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; })
pkgs.nerd-fonts.fira-code pkgs.nerd-fonts.fira-code
pkgs.nix-ld
# (pkgs.writeShellScriptBin "my-hello" '' # (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!" # echo "Hello, ${config.home.username}!"
# '') # '')
@@ -30,6 +32,15 @@
# ''; # '';
}; };
home.sessionVariables = {
NIX_LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [
stdenv.cc.cc
zlib
# Add other common libs here (glib, libx11, etc.)
];
NIX_LD = lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
};
# Home Manager can also manage your environment variables through # Home Manager can also manage your environment variables through
# 'home.sessionVariables'. If you don't want to manage your shell through Home # 'home.sessionVariables'. If you don't want to manage your shell through Home
# Manager then you have to manually source 'hm-session-vars.sh' located at # Manager then you have to manually source 'hm-session-vars.sh' located at
@@ -48,11 +59,8 @@
#home.sessionVariables = { #home.sessionVariables = {
# EDITOR = "nvim"; # EDITOR = "nvim";
#}; #};
#home.shellAliases = { #home.shellAliases = {
# "ll" = "ls -la"; # "ll" = "ls -la";
#};
# home.shellAliases = {
# "t" = "tmuxp"; # "t" = "tmuxp";
# "tl" = "tmuxp load"; # "tl" = "tmuxp load";
# }; # };

18
nix/flake.lock generated
View File

@@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1740579671, "lastModified": 1770164260,
"narHash": "sha256-Dwt/3KknOQ4bgFG5YjqDT7oWRy27rPpDjAi2P0ok1zw=", "narHash": "sha256-mQgOAYWlVJyuyXjZN6yxqXWyODvQI5P/UZUCU7IOuYo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "53c587d263f94aaf6a281745923c76bbec62bcf3", "rev": "4fda26500b4539e0a1e3afba9f0e1616bdad4f85",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -27,11 +27,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1740452771, "lastModified": 1770184146,
"narHash": "sha256-/tI1vFJ7/dXJqUmI+s0EV1F0DPe6dZvT444mrLUkrlU=", "narHash": "sha256-DsqnN6LvXmohTRaal7tVZO/AKBuZ02kPBiZKSU4qa/k=",
"owner": "LnL7", "owner": "LnL7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "42be12b510253d750138ec90c66decc282298b44", "rev": "0d7874ef7e3ba02d58bebb871e6e29da36fa1b37",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -42,11 +42,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1740367490, "lastModified": 1770115704,
"narHash": "sha256-WGaHVAjcrv+Cun7zPlI41SerRtfknGQap281+AakSAw=", "narHash": "sha256-KHFT9UWOF2yRPlAnSXQJh6uVcgNcWlFqqiAZ7OVlHNc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0196c0175e9191c474c26ab5548db27ef5d34b05", "rev": "e6eae2ee2110f3d31110d5c222cd395303343b08",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -13,7 +13,8 @@
outputs = { self, nix-darwin, nixpkgs, home-manager, ... }: outputs = { self, nix-darwin, nixpkgs, home-manager, ... }:
let let
system = "x86_64-darwin"; #system = "x86_64-darwin";
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
configuration = { pkgs, ... }: { configuration = { pkgs, ... }: {
@@ -60,6 +61,7 @@
./user/task_home.nix ./user/task_home.nix
]; ];
}; };
"martin" = home-manager.lib.homeManagerConfiguration { "martin" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
@@ -69,6 +71,7 @@
./user/task_home.nix ./user/task_home.nix
]; ];
}; };
"pan" = home-manager.lib.homeManagerConfiguration { "pan" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
@@ -76,6 +79,9 @@
./user/profiles/work.nix ./user/profiles/work.nix
./common.nix ./common.nix
./user/task.nix ./user/task.nix
{
nixpkgs.config.allowUnfree = true;
}
]; ];
}; };
}; };

206
nix/nixos/MIGRATION.md Normal file
View File

@@ -0,0 +1,206 @@
# Migration Guide: Channels → Flakes
## Why Migrate to Flakes?
**Reproducibility**: Lock files pin exact package versions
**Latest unstable packages**: Easy access to nixos-unstable
**Better for dotfiles**: Version control with exact dependencies
**Modern approach**: Future of Nix configuration
**You're ready**: You already have flakes enabled!
## Current State (Channels)
Your current setup:
```bash
/etc/nixos/configuration.nix # Channel-based, imports from <nixos-wsl/modules>
```
Commands:
```bash
sudo nix-channel --update
sudo nixos-rebuild switch
```
## Target State (Flakes)
New setup:
```bash
/home/pan/dev/config/dot/nix/nixos/
├── flake.nix # Declares inputs (nixpkgs, nixos-wsl, home-manager)
├── configuration.nix # System config (no imports needed)
├── home.nix # Your user config
└── modules/ # User modules
```
Commands:
```bash
nix flake update # Update dependencies
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix
```
## Migration Steps
### Step 1: Test the Flake Configuration
First, let's make sure it builds without applying:
```bash
cd /home/pan/dev/config/dot/nix/nixos
nix flake check --impure # Validate syntax
sudo nixos-rebuild build --flake .#nix --impure # Test build
```
If successful, you'll see a `result` symlink. The `--impure` flag is needed for NIX_LD settings.
### Step 2: Review What Will Change
Compare your current and new configs:
```bash
diff /etc/nixos/configuration.nix /home/pan/dev/config/dot/nix/nixos/configuration.nix
```
Key differences:
- ❌ Removed: `imports = [ <nixos-wsl/modules> <home-manager/nixos> ]`
- ✅ Added: Flake manages these as inputs
- ✅ Uses: nixos-unstable (latest packages)
- ✅ Locks: Exact versions in flake.lock
### Step 3: Apply the Flake Configuration
**Option A: Direct (Recommended)**
```bash
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
```
**Option B: Symlink to /etc/nixos (Optional)**
```bash
sudo mv /etc/nixos/configuration.nix /etc/nixos/configuration.nix.backup
sudo ln -s /home/pan/dev/config/dot/nix/nixos/flake.nix /etc/nixos/flake.nix
sudo ln -s /home/pan/dev/config/dot/nix/nixos/configuration.nix /etc/nixos/configuration.nix
sudo nixos-rebuild switch --flake /etc/nixos#nix --impure
```
### Step 4: Verify Everything Works
After switching:
```bash
# Check system info
nixos-version
# Check flake info
nix flake metadata /home/pan/dev/config/dot/nix/nixos
# Test your tools
zsh --version
tmux -V
nvim --version
git --version
task --version
```
### Step 5: Set Up Convenient Alias (Optional)
Add to your shell config:
```bash
alias nixos-update='cd /home/pan/dev/config/dot/nix/nixos && nix flake update && sudo nixos-rebuild switch --flake .#nix --impure'
alias nixos-rebuild-switch='sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure'
```
## Rollback Plan
If anything goes wrong, you can always rollback:
```bash
# List generations
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
# Rollback to previous generation
sudo nixos-rebuild switch --rollback
# Or select from boot menu
# Reboot and choose previous generation
```
Your old channel-based config is still at `/etc/nixos/configuration.nix.backup`.
## Common Commands
### With Flakes
```bash
# Update all inputs (nixpkgs, home-manager, nixos-wsl)
nix flake update
# Update just one input
nix flake lock --update-input nixpkgs
# Apply configuration
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
# Test without applying
sudo nixos-rebuild build --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
# Check what changed
nix flake metadata /home/pan/dev/config/dot/nix/nixos
git diff flake.lock # See version changes
```
### Garbage Collection
```bash
# Delete old generations (save disk space)
sudo nix-collect-garbage --delete-older-than 30d
# Full cleanup
sudo nix-collect-garbage -d
sudo nix-store --optimise
```
## FAQ
### Do I need to remove channels?
No, but you can clean them up:
```bash
sudo nix-channel --list # See current channels
sudo nix-channel --remove nixos # Remove if desired
```
### Will my existing packages break?
No! The flake uses the same package set (nixos-unstable). Your home-manager config stays the same.
### What about `--impure` flag?
You need it because `home.nix` uses `NIX_LD` which reads from the store at evaluation time. This is fine and expected for this use case.
### Can I still use `nixos-rebuild switch` without flags?
Not directly with flakes. But you can:
1. Create an alias (see Step 5)
2. Symlink to `/etc/nixos/flake.nix` and use `--flake /etc/nixos#nix`
### How do I update packages now?
```bash
# Update flake.lock to latest versions
nix flake update
# Then rebuild
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
```
## Benefits You'll Get
1. **Exact versions**: `flake.lock` pins everything
2. **Faster updates**: Only download what changed
3. **Better caching**: Flakes have better binary cache hits
4. **Git-friendly**: Your whole system in version control
5. **Easy sharing**: Others can reproduce your exact system
## Next Steps After Migration
1. ✅ Commit your configuration to git
2. ✅ Remove old channels (optional)
3. ✅ Set up shell aliases
4. ✅ Enjoy reproducible configs! 🎉

107
nix/nixos/QUICK_START.md Normal file
View File

@@ -0,0 +1,107 @@
# Quick Start Guide
## TL;DR - Should I Use Flakes?
**YES!** ✅ Use flakes because:
1. You get **nixos-unstable** (latest packages) with reproducibility
2. Your config is in **git** with locked versions (flake.lock)
3. You **already have flakes enabled** in your system
4. It's the **modern, recommended approach**
## Current vs Flake Setup
### Current (Channels) ❌
```bash
# Update
sudo nix-channel --update
sudo nixos-rebuild switch
# Config location
/etc/nixos/configuration.nix
# Package versions
Whatever the channel has (not locked)
```
### With Flakes (Recommended) ✅
```bash
# Update
nix flake update
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
# Config location
/home/pan/dev/config/dot/nix/nixos/
├── flake.nix (inputs: nixpkgs unstable, home-manager, nixos-wsl)
├── flake.lock (exact versions locked)
└── configuration.nix
# Package versions
Locked in flake.lock, reproducible everywhere
```
## Apply the Flake Configuration Now
### Step 1: Test it
```bash
cd /home/pan/dev/config/dot/nix/nixos
nix flake check --impure
sudo nixos-rebuild build --flake .#nix --impure
```
### Step 2: If successful, apply it
```bash
sudo nixos-rebuild switch --flake .#nix --impure
```
### Step 3: Verify
```bash
nixos-version
nix flake metadata /home/pan/dev/config/dot/nix/nixos
```
## What Changes?
- ✅ Same packages, just from nixos-unstable (usually newer)
- ✅ Same home-manager config (all your dotfiles stay)
- ✅ Same NixOS-WSL functionality
- ✅ Exact versions locked in flake.lock
- ✅ Easy to rollback (NixOS generations)
## Daily Usage
```bash
# Make config changes
vim /home/pan/dev/config/dot/nix/nixos/home.nix
# Apply
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
# Update packages (weekly/monthly)
cd /home/pan/dev/config/dot/nix/nixos
nix flake update
sudo nixos-rebuild switch --flake .#nix --impure
# Rollback if needed
sudo nixos-rebuild switch --rollback
```
## Create Convenience Alias
Add to your `~/.zshrc` or shell config:
```bash
# Quick rebuild
alias nr='sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure'
# Update and rebuild
alias nu='cd /home/pan/dev/config/dot/nix/nixos && nix flake update && sudo nixos-rebuild switch --flake .#nix --impure'
```
Then just run `nr` to rebuild!
## Need Help?
- Read [MIGRATION.md](MIGRATION.md) for detailed migration guide
- Read [README.md](README.md) for full documentation
- Check [TODO.md](TODO.md) for known issues

282
nix/nixos/README.md Normal file
View File

@@ -0,0 +1,282 @@
# NixOS-WSL Configuration for pan
This is a flake-based NixOS-WSL configuration ported from the standalone Home Manager setup. It provides a declarative, reproducible system configuration with integrated Home Manager and access to the latest unstable packages.
## Structure
```
nixos/
├── flake.nix # Flake with nixos-unstable, nixos-wsl, home-manager
├── flake.lock # Locked dependency versions (auto-generated)
├── configuration.nix # System-level NixOS-WSL configuration
├── home.nix # Home Manager user configuration
├── modules/ # User-level module configurations
│ ├── sh.nix # Shell (Zsh with Prezto, fzf, zoxide)
│ ├── tmux.nix # Tmux configuration
│ ├── git.nix # Git, Lazygit, Jujutsu
│ ├── nvim.nix # Neovim with 40+ plugins
│ ├── dev.nix # Development tools
│ └── task.nix # Taskwarrior, Timewarrior
├── README.md # This file
├── TODO.md # Known issues and future work
├── SUMMARY.md # Implementation overview
└── MIGRATION.md # Guide for migrating from channels to flakes
```
## Installation
### 1. Test the Configuration (Recommended First Step)
Before applying, validate and test build:
```bash
cd /home/pan/dev/config/dot/nix/nixos
# Validate flake syntax
nix flake check --impure
# Test build without activating
sudo nixos-rebuild build --flake .#nix --impure
```
The `--impure` flag is needed for NIX_LD settings in the home configuration.
### 2. Customize Configuration (Optional)
Edit `configuration.nix` to adjust:
- **Hostname**: Change `networking.hostName` (current: "nix")
- **Timezone**: Change `time.timeZone` (current: "Europe/Berlin")
- **WSL user**: Change `wsl.defaultUser` (current: "pan")
The current settings should work for your NixOS-WSL setup.
### 3. Apply Configuration
Apply the flake configuration:
```bash
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
```
Or from inside the directory:
```bash
cd /home/pan/dev/config/dot/nix/nixos
sudo nixos-rebuild switch --flake .#nix --impure
```
### 4. Verify Installation
After applying, verify everything works:
```bash
# Check system
nixos-version
# Check flake info
nix flake metadata /home/pan/dev/config/dot/nix/nixos
# Test your tools
zsh --version
tmux -V
nvim --version
```
## Updating the Configuration
After making changes to any configuration file:
```bash
sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix --impure
```
## Updating System Packages
To update all packages to the latest versions from nixos-unstable:
```bash
cd /home/pan/dev/config/dot/nix/nixos
# Update flake inputs (nixpkgs, home-manager, nixos-wsl)
nix flake update
# Apply the updates
sudo nixos-rebuild switch --flake .#nix --impure
```
View what changed:
```bash
git diff flake.lock # See version bumps
```
## Rollback
### Rollback to Previous Generation
If something breaks after an update:
```bash
sudo nixos-rebuild switch --rollback
```
### List All Generations
```bash
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
```
### Switch to Specific Generation
```bash
sudo nixos-rebuild switch --switch-generation <number>
```
### Rollback from Boot Menu
At boot time, select "NixOS - All configurations" to see all previous generations and boot into any of them.
## Differences from Original Ubuntu Configuration
### Removed Features
- **macOS/Darwin support**: All nix-darwin references removed
- **WSL-specific paths**: Hard-coded Windows paths in tmux configuration removed
- **Platform conditionals**: Darwin and Windows checks cleaned up
### System-Level Changes
- **User management**: User `pan` is now defined at the system level
- **Boot configuration**: Bootloader settings added
- **Networking**: NetworkManager enabled for network management
- **Zsh**: Enabled system-wide (configured via Home Manager)
### Custom Packages Status
The following custom packages from the original configuration are currently commented out in `modules/dev.nix`:
- `claude-code`
- `opencode`
- `gemini-cli`
See [TODO.md](TODO.md) for information on integrating these packages.
## Verification After Installation
### Test Shell Environment
```bash
# Verify zsh is running
echo $SHELL
# Test fzf (Ctrl+R for history search)
# Test zoxide
z /path/to/directory
# Test lsd, bat
lsd
bat some-file
```
### Test Tmux
```bash
# Start tmux
tmux new -s test
# Test custom keybindings:
# Alt+L/H - Next/previous window
# Alt+J/K - Next/previous session
# Ctrl+a + Ctrl+g - Lazygit popup
```
### Test Neovim
```bash
nvim test.nix
# Inside nvim:
# :LspInfo - Check LSP status
# :checkhealth - Check overall health
```
### Test Git & VCS
```bash
git config --get user.name # Should be "Martin Pander"
git config --get user.email # Should be "martin.pander@knowtion.de"
lazygit --version
jj --version
```
### Test Taskwarrior
```bash
task --version # Should be 3.x
tt # taskwarrior-tui
timew --version
```
### Test Development Tools
```bash
direnv --version
visidata --version
```
## Common Tasks
### Add a New Package
Edit `home.nix` or the appropriate module file, then rebuild:
```bash
sudo nixos-rebuild switch --flake .#nixos
```
### Enable a System Service
Edit `configuration.nix` to add the service, then rebuild:
```bash
sudo nixos-rebuild switch --flake .#nixos
```
### Cleanup Old Generations
Remove old generations to free up disk space:
```bash
# Delete generations older than 30 days
sudo nix-collect-garbage --delete-older-than 30d
# Or delete all old generations except current
sudo nix-collect-garbage -d
```
## Troubleshooting
### Build Fails
Check for syntax errors:
```bash
nix flake check
```
### Services Don't Start
Check service status:
```bash
systemctl status <service-name>
journalctl -u <service-name>
```
### Home Manager Issues
Rebuild Home Manager separately:
```bash
home-manager switch --flake .#pan
```
### NIX_LD Issues
If you encounter issues running non-Nix binaries, check that NIX_LD variables are set:
```bash
echo $NIX_LD
echo $NIX_LD_LIBRARY_PATH
```
## Resources
- [NixOS Manual](https://nixos.org/manual/nixos/stable/)
- [Home Manager Manual](https://nix-community.github.io/home-manager/)
- [Nixpkgs Search](https://search.nixos.org/packages)
- [NixOS Discourse](https://discourse.nixos.org/)
## Support
For issues specific to this configuration, see the TODO.md file for known limitations and planned improvements.

180
nix/nixos/SUMMARY.md Normal file
View File

@@ -0,0 +1,180 @@
# NixOS Configuration - Implementation Summary
This document summarizes the NixOS configuration that was created based on the migration plan.
## What Was Created
### Directory Structure
```
nixos/
├── flake.nix # NixOS flake (no nix-darwin)
├── flake.lock # Flake lockfile (auto-generated)
├── configuration.nix # System-level configuration
├── hardware-configuration.nix # Hardware template (MUST be replaced)
├── home.nix # Home Manager integration
├── modules/ # User-level configurations
│ ├── sh.nix # Shell (Zsh, Prezto, fzf, zoxide)
│ ├── tmux.nix # Tmux (WSL paths removed)
│ ├── git.nix # Git, Lazygit, Jujutsu
│ ├── nvim.nix # Neovim with 40+ plugins
│ ├── dev.nix # Dev tools (direnv, visidata)
│ └── task.nix # Taskwarrior, Timewarrior
├── README.md # Installation and usage guide
├── TODO.md # Remaining tasks and issues
└── SUMMARY.md # This file
```
## Key Changes from Original Configuration
### ✅ Removed
- **nix-darwin** input and outputs
- **macOS/Darwin** conditionals (lines 54-58 in sh.nix)
- **WSL** hard-coded paths (lines 31-32 in tmux.nix)
- **Windows** checks (lines 115-117 in sh.nix)
### ✅ Added
- **System-level configuration** (configuration.nix)
- Boot loader setup (systemd-boot)
- Networking with NetworkManager
- User account definition
- System timezone and locale
- Nix flakes enabled
- **Hardware configuration template** (hardware-configuration.nix)
- Placeholder for NixOS-generated config
- Must be replaced during installation
### ✅ Modified
- **Home Manager integration**
- Now runs as NixOS module (not standalone)
- useGlobalPkgs enabled
- Removed allowUnfree (handled at system level)
- **Shell configuration** (modules/sh.nix)
- Removed all platform-specific conditionals
- Clean Linux-only configuration
- Added `profileExtra` for .profile sourcing
- **Tmux configuration** (modules/tmux.nix)
- Commented out note keybindings (C-n, C-p)
- Paths need to be updated for NixOS environment
- **Development tools** (modules/dev.nix)
- Custom packages commented out:
- claude-code
- opencode
- gemini-cli
- TODO notes added for integration
## Validation Status
✅ Flake syntax is valid
✅ Configuration evaluates successfully
✅ All module imports resolve correctly
✅ No blocking errors found
⚠️ Requires `--impure` flag due to NIX_LD settings
## What Needs to Be Done Before Use
### 🔴 Critical (Must Do)
1. **Replace hardware-configuration.nix**
```bash
sudo nixos-generate-config --show-hardware-config > nixos/hardware-configuration.nix
```
2. **Update hostname** in configuration.nix
- Currently set to: "nixos"
- Change to your actual hostname
3. **Verify boot loader** choice in configuration.nix
- UEFI: systemd-boot (currently enabled)
- BIOS: GRUB (commented out)
### 🟡 Important (Should Do)
1. **Verify timezone** in configuration.nix
- Currently: "Europe/Berlin"
2. **Check locale settings** in configuration.nix
- Currently: en_US.UTF-8 / de_DE.UTF-8
3. **Verify nvim lua files** exist at:
- `/home/pan/dev/config/dot/nvim/base.lua`
- `/home/pan/dev/config/dot/nvim/keymaps.lua`
- `/home/pan/dev/config/dot/nvim/plugins.lua`
- `/home/pan/dev/config/dot/nvim/filetype.lua`
### 🟢 Optional (Nice to Have)
1. **Update tmux note paths** in modules/tmux.nix (C-n, C-p keybindings)
2. **Add custom packages** (claude-code, opencode, gemini-cli)
3. **Review and customize** any other settings
## How to Apply
### Test Build (Recommended First)
```bash
cd /home/pan/dev/config/dot/nix/nixos
sudo nixos-rebuild build --flake .#nixos --impure
```
### Apply Configuration
```bash
cd /home/pan/dev/config/dot/nix/nixos
sudo nixos-rebuild switch --flake .#nixos --impure
```
### Update Packages
```bash
nix flake update
sudo nixos-rebuild switch --flake .#nixos --impure
```
## Verification Checklist
After applying the configuration, verify:
- [ ] System boots successfully
- [ ] User 'pan' can login
- [ ] Zsh loads with Prezto theme
- [ ] fzf keybindings work (Ctrl+R)
- [ ] zoxide works (`cd` command)
- [ ] Tmux starts without errors
- [ ] Neovim opens with all plugins
- [ ] Git config shows correct user
- [ ] Lazygit and Jujutsu work
- [ ] Taskwarrior shows version 3.x
- [ ] Direnv loads .envrc files
## Files Preserved
The original Home Manager configuration remains untouched:
- `/home/pan/dev/config/dot/nix/flake.nix`
- `/home/pan/dev/config/dot/nix/common.nix`
- `/home/pan/dev/config/dot/nix/user/*`
You can continue using the Ubuntu setup alongside this NixOS configuration.
## Documentation
- **README.md**: Complete installation and usage guide
- **TODO.md**: Detailed list of remaining tasks and known issues
- **SUMMARY.md**: This file - quick overview and status
## Support
For issues or questions:
1. Check TODO.md for known issues
2. Review README.md for troubleshooting
3. Consult NixOS manual: https://nixos.org/manual/nixos/stable/
## Next Steps
1. ✅ Configuration created successfully
2. ⏳ Replace hardware-configuration.nix
3. ⏳ Update hostname and timezone
4. ⏳ Test build configuration
5. ⏳ Apply configuration
6. ⏳ Verify all components work
Good luck with your NixOS migration! 🚀

173
nix/nixos/TODO.md Normal file
View File

@@ -0,0 +1,173 @@
# TODO - NixOS Configuration
This file tracks remaining tasks and known issues for the NixOS configuration.
## High Priority
### Hardware Configuration
- [ ] Replace `hardware-configuration.nix` with actual generated configuration
- Run `sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix`
- Verify file systems are correctly configured
- Verify boot partition is correct
- Adjust CPU microcode (Intel vs AMD)
### System Settings
- [ ] Set correct hostname in `configuration.nix`
- [ ] Verify timezone setting (currently: Europe/Berlin)
- [ ] Verify locale settings (currently: en_US.UTF-8 / de_DE.UTF-8)
- [ ] Choose boot loader (systemd-boot vs GRUB)
## Medium Priority
### Custom Packages
The following packages need to be integrated or replaced:
- [ ] **claude-code**
- Check if available in nixpkgs
- If custom: create derivation in `packages/claude-code.nix`
- Or use alternative package manager (npm, pip, cargo)
- [ ] **opencode**
- Check if available in nixpkgs
- If custom: create derivation in `packages/opencode.nix`
- Or use alternative package manager
- [ ] **gemini-cli**
- Check if available in nixpkgs
- If custom: create derivation in `packages/gemini-cli.nix`
- Or use alternative package manager
### Tmux Configuration
- [ ] Update note popup keybindings (C-n, C-p) with correct NixOS paths
- Current: Commented out (had WSL hard-coded paths)
- Action: Decide on note location and update paths
- Example: `~/Documents/notes/Work/quick_notes.md`
- [ ] Verify `~/bin/tmuxp_selector.sh` script exists
- Used by `C-s` keybinding
- May need to be created or path adjusted
## Low Priority
### Shell Configuration
- [ ] Consider adding additional shell aliases
- [ ] Review if any macOS-specific tools need Linux alternatives
- [ ] Consider adding dircolors configuration
### Documentation
- [ ] Add screenshots of tmux setup
- [ ] Document custom Neovim configuration (lua files)
- [ ] Create troubleshooting guide for common issues
### Optimizations
- [ ] Consider using `programs.zsh.shellInit` vs `initContent`
- [ ] Review if `nix-ld` is actually needed (check use cases)
- [ ] Consider splitting large modules into smaller files
## Features Not Yet Ported
These were not in the original Home Manager config but might be useful on NixOS:
- [ ] Desktop environment / Window manager
- [ ] Display manager (GDM, SDDM, LightDM)
- [ ] Sound configuration (PipeWire/PulseAudio)
- [ ] Printing support
- [ ] Bluetooth support
- [ ] Docker / Podman
- [ ] Virtualization (QEMU/KVM)
## Known Issues
### Nvim Configuration Files
The nvim configuration references lua files from the parent directory:
```nix
initLua = builtins.concatStringsSep "\n" [
(lib.strings.fileContents ../../../nvim/base.lua)
(lib.strings.fileContents ../../../nvim/keymaps.lua)
(lib.strings.fileContents ../../../nvim/plugins.lua)
(lib.strings.fileContents ../../../nvim/filetype.lua)
];
```
**Status**: Should work if nvim/ directory exists at `/home/pan/dev/config/dot/nvim/`
**Action**: Verify these files exist or adjust paths
### Profile Loading
The shell configuration includes:
```nix
profileExtra = ''
source $HOME/.profile
'';
```
**Status**: Will fail silently if `~/.profile` doesn't exist
**Action**: Either create `~/.profile` or remove this line if not needed
## Testing Checklist
Before considering this configuration complete:
- [ ] System boots successfully
- [ ] User can login as `pan`
- [ ] Zsh loads with Prezto
- [ ] Tmux starts without errors
- [ ] Neovim opens and plugins load
- [ ] LSP servers work in Neovim
- [ ] Git commands work with correct identity
- [ ] Lazygit opens and works
- [ ] Jujutsu commands work
- [ ] Taskwarrior shows tasks
- [ ] Direnv loads `.envrc` files
- [ ] fzf keybindings work (Ctrl+R)
- [ ] zoxide navigation works
- [ ] All shell aliases work
## Future Enhancements
- [ ] Add backup/restore scripts
- [ ] Create CI/CD for testing configuration
- [ ] Add secrets management (agenix or sops-nix)
- [ ] Consider using flake-parts for better organization
- [ ] Add system monitoring tools
- [ ] Configure automatic updates
- [ ] Add custom shell functions
- [ ] Integrate with cloud sync for dotfiles
## Notes
### Differences from Ubuntu Setup
1. **No macOS support**: All Darwin-specific code removed
2. **No WSL support**: WSL-specific paths and checks removed
3. **System-level user**: User defined in NixOS config, not standalone
4. **Integrated Home Manager**: HM runs as NixOS module, not standalone
### Migration Path
If migrating from existing Ubuntu setup:
1. Backup current configuration
2. Install NixOS (keep Ubuntu if dual-boot)
3. Apply this configuration
4. Test all workflows
5. Import personal data (tasks, notes, etc.)
6. Verify custom packages availability
## Questions to Resolve
- [ ] What are the custom packages used for?
- [ ] Are there any private/work-specific configurations to add?
- [ ] Should we add any of the "Features Not Yet Ported"?
- [ ] Is GPU acceleration needed (NVIDIA, AMD)?
- [ ] Are there any cron jobs or systemd timers to configure?
- [ ] Should we enable fish or keep only zsh?
- [ ] Do we need any container tools (Docker, Podman)?

View File

@@ -0,0 +1,71 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
# NixOS-WSL specific options are documented on the NixOS-WSL repository:
# https://github.com/nix-community/NixOS-WSL
{ config, lib, pkgs, ... }:
{
wsl.enable = true;
wsl.defaultUser = "pan";
wsl.interop.register = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "25.05"; # Did you read the comment?
networking.hostName = "nix";
#networking.networkmanager.enable = true;
time.timeZone = "Europe/Berlin"; # Adjust to your timezone
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
users.users.pan = {
isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" ];
uid = 1000;
shell = pkgs.zsh;
};
programs.zsh.enable = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
};
nixpkgs.config.allowUnfree = true;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
# Automatic Store Optimization
nix.settings.auto-optimise-store = true;
environment.systemPackages = with pkgs; [
git
wget
curl
vim
];
}

View File

@@ -0,0 +1,64 @@
# NixOS-WSL Configuration
# This works with the flake.nix in this directory
#
# Apply with:
# sudo nixos-rebuild switch --flake /home/pan/dev/config/dot/nix/nixos#nix
{ config, lib, pkgs, ... }:
{
# WSL-specific settings
wsl.enable = true;
wsl.defaultUser = "pan";
wsl.interop.register = true;
# Networking
networking.hostName = "nix";
networking.networkmanager.enable = true;
# Time zone and locale
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
# User account
users.users.pan = {
isNormalUser = true;
description = "Martin Pander";
extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.zsh;
};
# Enable Zsh system-wide
programs.zsh.enable = true;
# Nix settings
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Minimal system packages (most go in Home Manager)
environment.systemPackages = with pkgs; [
vim
git
wget
curl
];
# NixOS version (don't change unless you know what you're doing)
system.stateVersion = "25.05";
}

86
nix/nixos/flake.lock generated Normal file
View File

@@ -0,0 +1,86 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1770318660,
"narHash": "sha256-yFVde8QZK7Dc0Xa8eQDsmxLX4NJNfL1NKfctSyiQgMY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "471e6a065f9efed51488d7c51a9abbd387df91b8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixos-wsl": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1769217863,
"narHash": "sha256-RY9kJDXD6+2Td/59LkZ0PFSereCXHdBX9wIkbYjRKCY=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "38a5250e57f583662eac3b944830e4b9e169e965",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NixOS-WSL",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1770197578,
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

48
nix/nixos/flake.nix Normal file
View File

@@ -0,0 +1,48 @@
{
description = "NixOS-WSL configuration for pan";
inputs = {
# Use nixos-unstable for latest packages
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# NixOS-WSL for WSL-specific functionality
nixos-wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home Manager for user configuration
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixos-wsl, home-manager, ... }:
let
system = "x86_64-linux";
in
{
nixosConfigurations = {
# Use your hostname: "nix"
nix = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
# NixOS-WSL module
nixos-wsl.nixosModules.wsl
# System configuration
./configuration.nix
# Home Manager as NixOS module
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.pan = import ./home.nix;
}
];
};
};
};
}

59
nix/nixos/home.nix Normal file
View File

@@ -0,0 +1,59 @@
{ config, pkgs, lib, ... }:
{
imports = [
./modules/sh.nix
./modules/tmux.nix
./modules/git.nix
./modules/dev.nix
./modules/nvim.nix
./modules/task.nix
];
# User details
home.username = "pan";
home.homeDirectory = "/home/pan";
# Git and Jujutsu user configuration
programs.git.settings.user = {
name = "Martin Pander";
email = "martin.pander@knowtion.de";
};
programs.jujutsu.settings.user = {
name = "Martin Pander";
email = "martin.pander@knowtion.de";
};
# Home packages
home.packages = with pkgs; [
nil # Nix LSP
nerd-fonts.fira-code
nix-ld
# Language servers
yaml-language-server
marksman
dockerfile-language-server
];
# NIX_LD settings for running non-Nix binaries
home.sessionVariables = {
NIX_LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [
stdenv.cc.cc
zlib
];
NIX_LD = lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
};
# Silence news display
news.display = "silent";
# Enable Home Manager self-management
programs.home-manager.enable = true;
# This value determines the Home Manager release which the configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
home.stateVersion = "25.05";
}

18
nix/nixos/modules/dev.nix Normal file
View File

@@ -0,0 +1,18 @@
{ config, pkgs, ... }:
{
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
home.packages = with pkgs; [
visidata
bubblewrap
claude-code
opencode
gemini-cli
];
}

88
nix/nixos/modules/git.nix Normal file
View File

@@ -0,0 +1,88 @@
{ config, pkgs, ... }:
{
programs.git = {
enable = true;
settings = {
alias = {
st = "status";
ci = "commit";
co = "checkout";
br = "branch";
pl = "pull";
ps = "push";
sw = "switch";
mno =" merge --no-ff";
lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit";
cleanup = "!git fetch --prune && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D";
};
column.ui = "auto";
branch.sort = "-committerdate";
tag.sort = "version:refname";
diff = {
algorithm = "histogram";
colorMoved = "plain";
mnemonicPrefix = "true";
renames = "true";
};
pull.rebase = "true";
push = {
default = "simple";
autoSetupRemote = "true";
followTags = "true";
};
fetch = {
prune = "true";
pruneTags = "true";
all = "true";
};
help.autocorrect = "prompt";
commit.verbose = "true";
rerere = {
enabled = "true";
autoupdate = "true";
};
rebase = {
autoSquas = "true";
autoStash = "true";
updateRefs = "true";
};
merge.conflictstyle = "zdiff3";
core.editor = "nvim";
init.defaultBranch = "main";
};
ignores = [
".direnv/"
".envrc"
];
};
programs.difftastic = {
enable = true;
git.enable = true;
};
programs.lazygit = {
enable = true;
settings = {
theme.lightTheme = "true";
git = {
log = {
format = "%C(yellow)%h%Creset %C(bold blue)<%an>%Creset %s %Cgreen(%cr)%Creset";
graph = "true";
};
};
};
};
programs.jujutsu = {
enable = true;
settings = {
aliases = {
tug = ["bookmark" "move" "--from" "heads(::@- & bookmarks())" "--to" "@-"];
};
};
};
}

View File

@@ -0,0 +1,86 @@
{ config, pkgs, lib, ... }:
{
programs.neovim = {
enable = true;
defaultEditor = true;
vimAlias = true;
plugins = with pkgs.vimPlugins; [
vim-repeat
vim-surround
ts-comments-nvim
vim-fugitive
gitsigns-nvim
nvim-tree-lua
targets-vim
mini-pairs
mini-align
mini-bracketed
mini-splitjoin
mini-move
mini-ai
mini-icons
flash-nvim
trouble-nvim
conform-nvim
nvim-lint
promise-async
nvim-ufo
vim-windowswap
plenary-nvim
telescope-nvim
telescope-fzf-native-nvim
telescope-ui-select-nvim
yanky-nvim
lualine-nvim
undotree
luasnip
nvim-cmp
cmp_luasnip
cmp-buffer
cmp-path
cmp-cmdline
cmp-nvim-lsp
cmp-nvim-lsp-signature-help
cmp_yanky
cmp-git
nvim-lspconfig
lspkind-nvim
copilot-lua
copilot-cmp
CopilotChat-nvim
bullets-vim
nvim-dap
nvim-nio
nvim-dap-ui
nvim-dap-virtual-text
nvim-dap-go
nvim-dap-python
nvim-dap-lldb
todo-comments-nvim
vim-markdown
zen-mode-nvim
plantuml-syntax
obsidian-nvim
render-markdown-nvim
image-nvim
img-clip-nvim
vim-nix
(nvim-treesitter.withPlugins (p: [ p.awk p.bash p.c p.c_sharp p.cpp p.css p.diff p.dockerfile p.doxygen p.git_config p.gitcommit p.go p.gomod p.gosum p.gotmpl p.helm p.haskell p.html p.http p.java p.javascript p.json p.latex p.lua p.markdown p.markdown_inline p.matlab p.nix p.printf p.python p.regex p.rust p.sql p.strace p.supercollider p.svelte p.swift p.terraform p.tmux p.toml p.typescript p.vim p.xml p.yaml p.zig ]))
];
initLua = builtins.concatStringsSep "\n" [
(lib.strings.fileContents ../../../nvim/base.lua)
(lib.strings.fileContents ../../../nvim/keymaps.lua)
(lib.strings.fileContents ../../../nvim/plugins.lua)
(lib.strings.fileContents ../../../nvim/filetype.lua)
];
};
home.packages = with pkgs; [
nodejs-slim
marksman
];
}

99
nix/nixos/modules/sh.nix Normal file
View File

@@ -0,0 +1,99 @@
{ config, pkgs, lib, ... }:
{
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
history.size = 500000;
prezto = {
enable = true;
caseSensitive = true;
color = true;
editor = {
dotExpansion = true;
keymap = "vi";
};
pmodules = [
"environment"
"terminal"
"editor"
"history"
"directory"
"spectrum"
"utility"
"completion"
"syntax-highlighting"
"history-substring-search"
"prompt"
"git"
];
prompt.theme = "minimal";
syntaxHighlighting.highlighters = [
"main"
"brackets"
"pattern"
"line"
"cursor"
"root"
];
tmux = {
autoStartLocal = true;
itermIntegration = true;
};
};
initContent = ''
HISTCONTROL='erasedups:ignoreboth'
HISTIGNORE='&:[ ]*:exit:ls:bg:fg:history:clear'
unsetopt beep
'';
profileExtra = ''
source $HOME/.profile
'';
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.lsd = {
enable = true;
enableZshIntegration = true;
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
options = [
"--cmd cd"
];
};
programs.bat.enable = true;
programs.ripgrep.enable = true;
programs.btop.enable = true;
programs.ranger.enable = true;
home.packages = with pkgs; [
fd
dust
glow
ripgrep-all
viddy
duf
];
home.sessionVariables = {
BAT_THEME = "Coldark-Cold";
};
home.shellAliases = {
lst = "lsd --tree";
};
}

View File

@@ -0,0 +1,75 @@
{config, pkgs, lib, ...}:
{
programs.taskwarrior = {
enable = true;
colorTheme = "light-256";
package = pkgs.taskwarrior3;
config = {
weekstart = "monday";
uda.tasksquire.tags.default="code,comm,cust,del,doc,mngmnt,ops,rsrch,rvw,track";
uda.parenttask.type="string";
uda.parenttask.label="Parent";
uda.energy.type="string";
uda.energy.label="Energy";
uda.energy.values="h,m,l";
uda.energy.default="m";
uda.priority.values = "H,M,,L";
urgency.uda.priority.L.coefficient = -0.5;
urgency.user.tag.deferred.coefficient = -15.0;
urgency.user.tag.cust.coefficient = 5.0;
urgency.user.tag.fixed.coefficient = -100.0;
report.next.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.next.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.next.filter="status:pending -WAITING -deferred -track";
report.time.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.time.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.time.filter="status:pending -WAITING -deferred +fixed";
report.deferred.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.deferred.context="1";
report.deferred.description="Deferred and waiting tasks";
report.deferred.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.deferred.filter="status:pending +deferred";
report.deferred.sort="urgency-";
report.low.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.low.context="1";
report.low.description="Low energy tasks";
report.low.filter="status:pending -WAITING -deferred";
report.low.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.low.sort="energy+,urgency-";
context.today.read = "(prio:H or +next)";
context.today.write = "prio:H +next";
context.deferred.read = "+deferred";
context.deferred.write = "+deferred";
context.customer.read = "+cust";
context.customer.write = "+cust";
context.low_energy.read = "+low";
context.low_energy.write = "+low";
uda.taskwarrior-tui.task-report.show-info = false;
uda.taskwarrior-tui.selection.reverse = "yes";
};
};
home.packages = with pkgs; [
taskwarrior-tui
timewarrior
];
home.shellAliases = lib.mkMerge [ {
t = "task";
tt = "taskwarrior-tui";
tw = "timew";
tws = "timew summary :ids";
}
];
}

View File

@@ -0,0 +1,73 @@
{ config, pkgs, lib, ... }:
{
programs.tmux = {
enable = true;
shortcut = "a";
mouse = true;
keyMode = "vi";
escapeTime = 0;
terminal = "screen-256color";
tmuxp.enable = true;
extraConfig = ''
set -g display-time 1500
unbind S
bind S command-prompt "switch -t %1"
bind-key -n M-K switch-client -p
bind-key -n M-J switch-client -n
bind-key -n M-L next-window
bind-key -n M-H previous-window
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -a -c "#{pane_current_path}"
bind C-s display-popup -E "zsh ~/bin/tmuxp_selector.sh"
bind C-g display-popup -E -d "#{pane_current_path}" -xC -yC -w 95% -h 95% "lazygit"
bind C-t display-popup -E -xC -yC -w 95% -h 95% "tasksquire"
# Note: The following keybindings had hard-coded WSL paths that were removed.
# Adjust the paths below to match your NixOS environment:
# bind C-n display-popup -E -xC -yC -w 95% -h 95% -d "~/Documents/notes/Work/" "vim quick_notes.md"
# bind C-p display-popup -E -xC -yC -w 95% -h 95% -d "~/Documents/notes/Work/development/" "vim mbpr.md"
#######################################
# status line
#######################################
set -g status-justify centre
set -g status-left "#[bg=#808080,fg=#ffffff,bold] #S #[default]#[bg=#BCBCBC] #{-30:pane_title} "
set -g status-left-length 40
set -g status-right "#[bg=#BCBCBC] %H:%M #[bg=#808080,fg=#ffffff] %d.%m.%y "
# setw -g window-status-format " #W#F "
# setw -g window-status-current-format " #W#F "
setw -g window-status-format " #W "
setw -g window-status-current-format " #W "
setw -g window-status-separator ""
#######################################
# colors, taken from vim-lucius
#######################################
set -g status-style "bg=#DADADA,fg=#000000"
setw -g window-status-style "bg=#BCBCBC,fg=#000000"
setw -g window-status-current-style "bg=#808080,fg=#ffffff"
setw -g window-status-activity-style "bg=#AFD7AF,fg=#000000"
setw -g window-status-bell-style "bg=#AFD7AF,fg=#000000"
#setw -g window-status-content-style "bg=#AFD7AF,fg=#000000"
set -g pane-active-border-style "bg=#eeeeee,fg=#006699"
set -g pane-border-style "bg=#eeeeee,fg=#999999"
'';
};
home.shellAliases = {
"o" = "tmuxp";
"ol" = "tmuxp load";
};
}

1
nix/nixos/result Symbolic link
View File

@@ -0,0 +1 @@
/nix/store/sdjnb1hp96jbv904y92vnil7cjnc8x78-nixos-system-nix-26.05.20260204.00c21e4

View File

@@ -7,5 +7,12 @@
nix-direnv.enable = true; nix-direnv.enable = true;
}; };
programs.ripgrep.enable = true; home.packages = with pkgs; [
visidata
claude-code
opencode
gemini-cli
bubblewrap
# crush
];
} }

View File

@@ -3,21 +3,20 @@
{ {
programs.git = { programs.git = {
enable = true; enable = true;
settings = {
aliases = { alias = {
st = "status"; st = "status";
ci = "commit"; ci = "commit";
co = "checkout"; co = "checkout";
br = "branch"; br = "branch";
pl = "pull"; pl = "pull";
ps = "push"; ps = "push";
sw = "switch";
mno =" merge --no-ff"; mno =" merge --no-ff";
lg = "log --color --graph --pretty=format:'%cred%h%creset -%c(yellow)%d%creset %s %cgreen(%cr)%c(bold blue)<%an>%creset' --abbrev-commit"; lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit";
cleanup = "!git fetch --prune && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D";
}; };
difftastic.enable = true;
extraConfig = {
column.ui = "auto"; column.ui = "auto";
branch.sort = "-committerdate"; branch.sort = "-committerdate";
tag.sort = "version:refname"; tag.sort = "version:refname";
@@ -59,4 +58,31 @@
".envrc" ".envrc"
]; ];
}; };
programs.difftastic = {
enable = true;
git.enable = true;
};
programs.lazygit = {
enable = true;
settings = {
theme.lightTheme = "true";
git = {
log = {
format = "%C(yellow)%h%Creset %C(bold blue)<%an>%Creset %s %Cgreen(%cr)%Creset";
graph = "true";
};
};
};
};
programs.jujutsu = {
enable = true;
settings = {
aliases = {
tug = ["bookmark" "move" "--from" "heads(::@- & bookmarks())" "--to" "@-"];
};
};
};
} }

View File

@@ -8,25 +8,37 @@
vimAlias = true; vimAlias = true;
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
aerial-nvim
zen-mode-nvim
vim-commentary
vim-repeat vim-repeat
vim-surround vim-surround
ts-comments-nvim
vim-fugitive
gitsigns-nvim
nvim-tree-lua
targets-vim targets-vim
delimitMate mini-pairs
# vim-startify mini-align
mini-bracketed
mini-splitjoin
mini-move
mini-ai
mini-icons
flash-nvim
trouble-nvim
conform-nvim
nvim-lint
promise-async
nvim-ufo
vim-windowswap vim-windowswap
vim-nix
plenary-nvim plenary-nvim
telescope-nvim telescope-nvim
telescope-fzf-native-nvim telescope-fzf-native-nvim
telescope-ui-select-nvim
yanky-nvim yanky-nvim
lualine-nvim lualine-nvim
undotree undotree
vim-vsnip luasnip
nvim-cmp nvim-cmp
cmp-vsnip cmp_luasnip
cmp-buffer cmp-buffer
cmp-path cmp-path
cmp-cmdline cmp-cmdline
@@ -38,10 +50,24 @@
lspkind-nvim lspkind-nvim
copilot-lua copilot-lua
copilot-cmp copilot-cmp
CopilotChat-nvim
bullets-vim
nvim-dap
nvim-nio
nvim-dap-ui
nvim-dap-virtual-text
nvim-dap-go
nvim-dap-python
nvim-dap-lldb
todo-comments-nvim
vim-markdown
zen-mode-nvim
plantuml-syntax
obsidian-nvim
render-markdown-nvim
image-nvim image-nvim
img-clip-nvim img-clip-nvim
markdown-preview-nvim vim-nix
vim-markdown
(nvim-treesitter.withPlugins (p: [ p.awk p.bash p.c p.c_sharp p.cpp p.css p.diff p.dockerfile p.doxygen p.git_config p.gitcommit p.go p.gomod p.gosum p.gotmpl p.helm p.haskell p.html p.http p.java p.javascript p.json p.latex p.lua p.markdown p.markdown_inline p.matlab p.nix p.printf p.python p.regex p.rust p.sql p.strace p.supercollider p.svelte p.swift p.terraform p.tmux p.toml p.typescript p.vim p.xml p.yaml p.zig ])) (nvim-treesitter.withPlugins (p: [ p.awk p.bash p.c p.c_sharp p.cpp p.css p.diff p.dockerfile p.doxygen p.git_config p.gitcommit p.go p.gomod p.gosum p.gotmpl p.helm p.haskell p.html p.http p.java p.javascript p.json p.latex p.lua p.markdown p.markdown_inline p.matlab p.nix p.printf p.python p.regex p.rust p.sql p.strace p.supercollider p.svelte p.swift p.terraform p.tmux p.toml p.typescript p.vim p.xml p.yaml p.zig ]))
]; ];
@@ -49,10 +75,11 @@
# set t_vb= # set t_vb=
# ''; # '';
extraLuaConfig = builtins.concatStringsSep "\n" [ initLua = builtins.concatStringsSep "\n" [
(lib.strings.fileContents ../../nvim/base.lua) (lib.strings.fileContents ../../nvim/base.lua)
(lib.strings.fileContents ../../nvim/keymaps.lua) (lib.strings.fileContents ../../nvim/keymaps.lua)
(lib.strings.fileContents ../../nvim/plugins.lua) (lib.strings.fileContents ../../nvim/plugins.lua)
(lib.strings.fileContents ../../nvim/filetype.lua)
]; ];
}; };

View File

@@ -6,15 +6,21 @@
home.stateVersion = "23.11"; # Please read the comment before changing. home.stateVersion = "23.11"; # Please read the comment before changing.
programs.git = { programs.git.settings.user = {
userName = "Martin Pander"; name = "Martin Pander";
userEmail = "martin.pander@knowtion.de"; email = "martin.pander@knowtion.de";
}; };
programs.jujutsu.settings.user = {
name = "Martin Pander";
email = "martin.pander@knowtion.de";
};
home.packages = with pkgs; [ home.packages = with pkgs; [
yaml-language-server yaml-language-server
marksman marksman
dockerfile-language-server-nodejs dockerfile-language-server
]; ];
programs.zsh.profileExtra = '' programs.zsh.profileExtra = ''

View File

@@ -46,10 +46,21 @@
}; };
}; };
initExtra = '' initContent = ''
HISTCONTROL='erasedups:ignoreboth' HISTCONTROL='erasedups:ignoreboth'
HISTIGNORE='&:[ ]*:exit:ls:bg:fg:history:clear' HISTIGNORE='&:[ ]*:exit:ls:bg:fg:history:clear'
unsetopt beep unsetopt beep
if [[ "$(uname -s)" == "Darwin" ]]; then
export RUSTUP_HOME="$HOME/.rustup"
export CARGO_HOME="$HOME/.cargo"
[ -f "$CARGO_HOME/env" ] && . "$CARGO_HOME/env"
fi;
if [[ "$(uname -r)" == *Microsoft* ]]; then
if command -v tmuxp &> /dev/null && [ -z "$TMUX" ]; then
tmuxp load --yes misc
fi
fi;
''; '';
}; };
@@ -60,7 +71,7 @@
programs.lsd = { programs.lsd = {
enable = true; enable = true;
enableAliases = true; enableZshIntegration = true;
}; };
programs.zoxide = { programs.zoxide = {
@@ -73,18 +84,36 @@
programs.bat.enable = true; programs.bat.enable = true;
programs.ripgrep.enable = true; programs.ripgrep.enable = true;
programs.btop.enable = true;
programs.ranger.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [
fd fd
du-dust dust
glow glow
ripgrep-all ripgrep-all
llm viddy
#nerdfonts duf
# (llm.withPlugins (ps: [
# ps.llm-gemini
# ps.llm-claude
# ]))
]; ];
home.sessionVariables = lib.mkMerge [ { home.sessionVariables = lib.mkMerge [ {
BAT_THEME = "Coldark-Cold"; BAT_THEME = "Coldark-Cold";
} }
]; ];
home.shellAliases = lib.mkMerge [
{
lst = "lsd --tree";
}
# This is the correct way to use lib.mkIf within lib.mkMerge
# (lib.mkIf pkgs.stdenv.targetPlatform.isWindows {
(lib.mkIf (lib.strings.hasSuffix "windows" pkgs.system) {
open = "explorer.exe .";
})
];
} }

View File

@@ -8,13 +8,46 @@
config = { config = {
weekstart = "monday"; weekstart = "monday";
uda.tasksquire.tags.default="code,comm,cust,del,doc,mngmnt,ops,rsrch,rvw,track";
uda.parenttask.type="string";
uda.parenttask.label="Parent";
uda.energy.type="string";
uda.energy.label="Energy";
uda.energy.values="h,m,l";
uda.energy.default="m";
uda.priority.values = "H,M,,L"; uda.priority.values = "H,M,,L";
urgency.uda.priority.L.coefficient = -0.5; urgency.uda.priority.L.coefficient = -0.5;
urgency.user.tag.deferred.coefficient = -15.0; urgency.user.tag.deferred.coefficient = -15.0;
urgency.user.tag.cust.coefficient = 5.0; urgency.user.tag.cust.coefficient = 5.0;
urgency.user.tag.fixed.coefficient = -100.0;
context.today.read = "-deferred and (prio:H or +next)"; report.next.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
context.today.write = "prio:H or +next"; report.next.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.next.filter="status:pending -WAITING -deferred -track";
report.time.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.time.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.time.filter="status:pending -WAITING -deferred +fixed";
report.deferred.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.deferred.context="1";
report.deferred.description="Deferred and waiting tasks";
report.deferred.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.deferred.filter="status:pending +deferred";
report.deferred.sort="urgency-";
report.low.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.low.context="1";
report.low.description="Low energy tasks";
report.low.filter="status:pending -WAITING -deferred";
report.low.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.low.sort="energy+,urgency-";
context.today.read = "(prio:H or +next)";
context.today.write = "prio:H +next";
context.deferred.read = "+deferred"; context.deferred.read = "+deferred";
context.deferred.write = "+deferred"; context.deferred.write = "+deferred";
context.customer.read = "+cust"; context.customer.read = "+cust";

View File

@@ -25,6 +25,12 @@
bind % split-window -h -c "#{pane_current_path}" bind % split-window -h -c "#{pane_current_path}"
bind c new-window -a -c "#{pane_current_path}" bind c new-window -a -c "#{pane_current_path}"
bind C-s display-popup -E "zsh ~/bin/tmuxp_selector.sh"
bind C-g display-popup -E -d "#{pane_current_path}" -xC -yC -w 95% -h 95% "lazygit"
bind C-t display-popup -E -xC -yC -w 95% -h 95% "tasksquire"
bind C-n display-popup -E -xC -yC -w 95% -h 95% -d "/mnt/c/Users/marti/Documents/notes/Work/" "vim quick_notes.md"
bind C-p display-popup -E -xC -yC -w 95% -h 95% -d "/mnt/c/Users/marti/Documents/notes/Work/development/" "vim mbpr.md"
####################################### #######################################
# status line # status line
####################################### #######################################

View File

@@ -1,11 +1,14 @@
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
------------------------- -------------------------
-------- OPTIONS -------- -------- OPTIONS --------
------------------------- -------------------------
vim.opt.mouse = 'a' vim.opt.mouse = 'a'
vim.opt.history = 1000 vim.opt.history = 1000
vim.opt.ruler = true vim.opt.ruler = true
vim.opt.ruler = true
vim.opt.number = true vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.showcmd = true vim.opt.showcmd = true
vim.opt.ttimeoutlen = 100 vim.opt.ttimeoutlen = 100
vim.opt.backspace = 'indent,eol,start' vim.opt.backspace = 'indent,eol,start'
@@ -23,7 +26,8 @@ vim.opt.smartcase = true
vim.opt.hidden = true vim.opt.hidden = true
vim.opt.splitright = true vim.opt.splitright = true
vim.opt.splitbelow = true vim.opt.splitbelow = true
vim.opt.swapfile = false vim.opt.swapfile = true
vim.opt.directory= '~/.cache/nvim/swap//,$TEMP//,/tmp//'
vim.opt.wildmode = 'longest,list' vim.opt.wildmode = 'longest,list'
vim.opt.wildignore = vim.opt.wildignore + 'main,*.o,*.d,*.aux,*.bbl,*.lof,*.loa,*.blg,*.fdb_latexmk,*.fls,*.tdo,*.pdf,*.pyc' vim.opt.wildignore = vim.opt.wildignore + 'main,*.o,*.d,*.aux,*.bbl,*.lof,*.loa,*.blg,*.fdb_latexmk,*.fls,*.tdo,*.pdf,*.pyc'
vim.opt.spell = false vim.opt.spell = false
@@ -34,7 +38,7 @@ vim.opt.lazyredraw = true
vim.opt.listchars = 'eol:¬,tab:▸ ,trail:·' vim.opt.listchars = 'eol:¬,tab:▸ ,trail:·'
vim.opt.fillchars = 'vert:|,fold: ' vim.opt.fillchars = 'vert:|,fold: '
vim.opt.list = true vim.opt.list = true
vim.opt.laststatus = 2 vim.opt.laststatus = 3
vim.opt.scrolloff = 8 vim.opt.scrolloff = 8
vim.opt.background = 'light' vim.opt.background = 'light'
vim.opt.wrap = true vim.opt.wrap = true
@@ -46,14 +50,16 @@ vim.opt.autoread = true
vim.opt.syntax = 'on' vim.opt.syntax = 'on'
vim.opt.encoding = 'utf-8' vim.opt.encoding = 'utf-8'
vim.opt.completeopt = 'menu,menuone,noselect' vim.opt.completeopt = 'menu,menuone,noselect'
vim.opt.termguicolors = true
vim.opt.conceallevel = 1
---------------------------- ----------------------------
-------- CLIPBOARD --------- -------- CLIPBOARD ---------
---------------------------- ----------------------------
-- if vim.fn.has("wsl") == 1 then if vim.fn.has("wsl") == 1 then
vim.opt.clipboard:append('unnamedplus') vim.opt.clipboard = vim.opt.clipboard + 'unnamedplus'
-- end end
---------------------------- ----------------------------
@@ -78,12 +84,46 @@ vim.api.nvim_create_autocmd({'FocusGained', 'BufEnter', 'CursorMoved', 'CursorMo
command = 'silent! checktime' command = 'silent! checktime'
}) })
vim.api.nvim_create_autocmd('BufEnter', { -- vim.api.nvim_create_autocmd('BufEnter', {
group = 'VimIntern', -- group = 'VimIntern',
pattern = '*', -- pattern = '*',
command = 'silent! lcd %:p:h' -- command = 'silent! lcd %:p:h'
}) -- })
-- Open nvim-tree when starting Neovim in a specific directory or any of its subdirectories
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
local args = vim.fn.argv()
if #args > 0 then
local current_dir = vim.fn.fnamemodify(args[1], ":p:h")
local dir_name = vim.fn.fnamemodify(current_dir, ":t")
-- Check if in a "notes" directory or its subdirectory
local in_notes = dir_name == "notes"
if not in_notes then
-- Check if any parent directory is named "notes"
local path_parts = vim.split(current_dir, "/", {plain = true})
for i, part in ipairs(path_parts) do
if part == "notes" then
in_notes = true
break
end
end
end
-- If in a notes directory or subdirectory, open the tree
if in_notes then
require("nvim-tree.api").tree.open()
vim.defer_fn(function()
require("nvim-tree.api").tree.expand_all()
-- After expanding, return focus to the main window/buffer
vim.cmd("wincmd p")
end, 100) -- Small delay to ensure tree is fully loaded before expanding
end
end
end
})
--------------------------- ---------------------------
-------- FUNCTIONS -------- -------- FUNCTIONS --------
@@ -92,3 +132,51 @@ vim.api.nvim_create_autocmd('BufEnter', {
vim.api.nvim_create_user_command('TrimWhiteSpace', function() vim.api.nvim_create_user_command('TrimWhiteSpace', function()
vim.cmd('%s/\\s\\+$//e') vim.cmd('%s/\\s\\+$//e')
end, {}) end, {})
local function ToggleDiagnostics()
vim.diagnostic.enable(not vim.diagnostic.is_enabled())
if vim.diagnostic.is_enabled() then
print("Diagnostics enabled")
else
print("Diagnostics disabled")
end
end
---------------------------
------- DIAGNOSTICS -------
---------------------------
vim.diagnostic.config({
update_in_insert = true,
signs = true,
virtual_text = {
prefix = '',
current_line = false,
severity = {
-- min = vim.diagnostic.severity.INFO,
max = vim.diagnostic.severity.INFO,
},
},
virtual_lines = {
current_line = false,
severity = {
min = vim.diagnostic.severity.WARN,
-- max = vim.diagnostic.severity.WARN,
},
},
float = {
prefix = '',
focusable = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
},
})
vim.cmd([[highlight DiagnosticUnderlineError gui=undercurl guifg=Red]])
vim.cmd([[highlight DiagnosticUnderlineWarn gui=undercurl guifg=Yellow]])
vim.cmd([[highlight DiagnosticUnderlineInfo gui=undercurl guifg=Blue]])
vim.cmd([[highlight DiagnosticUnderlineHint gui=undercurl guifg=Cyan]])

163
nvim/filetype.lua Normal file
View File

@@ -0,0 +1,163 @@
local capabilities = require('cmp_nvim_lsp').default_capabilities()
vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true })
vim.api.nvim_create_autocmd('FileType', {
group = 'FileTypeConfigs',
pattern = 'python',
callback = function()
require('dap-python').setup()
-- lspconfig.pyright.setup({ capabilities = capabilities })
-- require("conform").setup({
-- python = {"black"},
-- })
end,
})
-- vim.api.nvim_create_autocmd('FileType', {
-- group = 'FileTypeConfigs',
-- pattern = 'go',
-- callback = function()
-- require('dap-python').setup()
-- require('dap-go').setup()
vim.lsp.enable('ruff')
vim.lsp.enable('gopls')
vim.lsp.enable('marksman')
vim.lsp.enable('rust_analyzer')
vim.lsp.enable('dockerls')
vim.lsp.enable('docker_compose_language_service')
vim.lsp.enable('clangd')
vim.lsp.enable('sqls')
vim.lsp.enable('zls')
vim.lsp.enable('omnisharp')
vim.lsp.enable('yamlls')
-- lspconfig.gopls.setup({ capabilities = capabilities })
-- lspconfig.marksman.setup({ capabilities = capabilities })
-- lspconfig.rust_analyzer.setup({
-- capabilities = capabilities,
-- settings = {
-- ["rust-analyzer"] = {
-- checkOnSave = {
-- command = "clippy",
-- },
-- },
-- },
-- })
-- lspconfig.dockerls.setup({ capabilities = capabilities })
-- lspconfig.docker_compose_language_service.setup({ capabilities = capabilities })
-- lspconfig.clangd.setup({ capabilities = capabilities })
-- lspconfig.sqls.setup({ capabilities = capabilities })
-- lspconfig.zls.setup({ capabilities = capabilities })
-- lspconfig.omnisharp.setup({ capabilities = capabilities })
-- lspconfig.yamlls.setup({ capabilities = capabilities })
require("conform").setup({
go = {"gofmt"},
python = {"black"},
rust = {"rustfmt"},
})
-- end,
-- })
-- vim.api.nvim_create_autocmd('FileType', {
-- group = 'FileTypeConfigs',
-- pattern = 'rust',
-- callback = function()
-- require('dap-python').setup()
--
-- lspconfig.rust_analyzer.setup({
-- capabilities = capabilities,
-- settings = {
-- ["rust-analyzer"] = {
-- checkOnSave = {
-- command = "clippy",
-- },
-- },
-- },
-- })
--
-- require("conform").setup({
-- rust = {"rustfmt"},
-- })
-- end,
-- })
-- vim.api.nvim_create_autocmd('FileType', {
-- group = 'FileTypeConfigs',
-- pattern = 'markdown',
-- callback = function()
-- lspconfig.marksman.setup({ capabilities = capabilities })
-- end,
-- })
--
-- vim.api.nvim_create_autocmd('FileType', {
-- group = 'FileTypeConfigs',
-- pattern = 'dockerfile',
-- callback = function()
-- lspconfig.dockerls.setup({ capabilities = capabilities })
-- lspconfig.docker_compose_language_service.setup({ capabilities = capabilities })
-- end,
-- })
--
-- vim.api.nvim_create_autocmd('FileType', {
-- group = 'FileTypeConfigs',
-- pattern = 'cs',
-- callback = function()
-- lspconfig.omnisharp.setup({ capabilities = capabilities })
-- end,
-- })
--
-- vim.api.nvim_create_autocmd('FileType', {
-- group = 'FileTypeConfigs',
-- pattern = 'yaml',
-- callback = function()
-- lspconfig.yamlls.setup({ capabilities = capabilities })
-- lspconfig.docker_compose_language_service.setup({ capabilities = capabilities })
-- end,
-- })
-- vim.api.nvim_create_autocmd('FileType', {
-- group = 'FileTypeConfigs',
-- pattern = {'c', 'cpp', 'objc', 'objcpp'},
-- callback = function()
-- lspconfig.clangd.setup({ capabilities = capabilities })
-- end,
-- })
--
-- vim.api.nvim_create_autocmd('FileType', {
-- group = 'FileTypeConfigs',
-- pattern = 'sql',
-- callback = function()
-- lspconfig.sqls.setup({ capabilities = capabilities })
-- end,
-- })
--
-- vim.api.nvim_create_autocmd('FileType', {
-- group = 'FileTypeConfigs',
-- pattern = 'zig',
-- callback = function()
-- lspconfig.zls.setup({ capabilities = capabilities })
-- end,
-- })
--
local get_datetime = function()
return os.date("%Y-%m-%d %H:%M")
end
local ls = require('luasnip')
ls.add_snippets("markdown", {
ls.snippet("mindful", {
-- Inserts the output of the get_datetime function as static text
ls.function_node(get_datetime, {}),
ls.text_node(" -- "),
ls.insert_node(1, "project"),
ls.text_node(" -- "),
ls.insert_node(2, "mode"),
ls.text_node(" -- "),
ls.insert_node(3, "description"),
}, {
descr = "Mindful of distractions",
}),
})

View File

@@ -1,21 +1,32 @@
vim.g.mapleader = " " vim.g.mapleader = " "
-- Navigation -- Navigation
vim.keymap.set('n', 'j', 'gj', {}) vim.keymap.set({'n', 'v'}, 'j', 'gj', {})
vim.keymap.set('n', 'k', 'gk', {}) vim.keymap.set({'n', 'v'}, 'k', 'gk', {})
vim.keymap.set('v', 'j', 'gj', {})
vim.keymap.set('v', 'k', 'gk', {})
vim.keymap.set('n', '<C-h>', '<C-w>h', {}) vim.keymap.set('n', '<C-M-h>', '<C-w>h', {})
vim.keymap.set('n', '<C-j>', '<C-w>j', {}) vim.keymap.set('n', '<C-M-j>', '<C-w>j', {})
vim.keymap.set('n', '<C-k>', '<C-w>k', {}) vim.keymap.set('n', '<C-M-k>', '<C-w>k', {})
vim.keymap.set('n', '<C-l>', '<C-w>l', {}) vim.keymap.set('n', '<C-M-l>', '<C-w>l', {})
vim.keymap.set('t', '<C-M-h>', '<C-\\><C-n><C-w>h', {})
vim.keymap.set('t', '<C-M-j>', '<C-\\><C-n><C-w>j', {})
vim.keymap.set('t', '<C-M-k>', '<C-\\><C-n><C-w>k', {})
vim.keymap.set('t', '<C-M-l>', '<C-\\><C-n><C-w>l', {})
vim.keymap.set('n', '<leader>zm', '<C-W>_<C-W>|', { noremap = true, silent = true })
vim.keymap.set('n', '<C-M-Y>', '<C-w>5<', {})
vim.keymap.set('n', '<C-M-U>', '<C-w>5+', {})
vim.keymap.set('n', '<C-M-I>', '<C-w>5-', {})
vim.keymap.set('n', '<C-M-O>', '<C-w>5>', {})
vim.keymap.set('t', '<C-M-Y>', '<C-\\><C-n><C-w>5<', {})
vim.keymap.set('t', '<C-M-U>', '<C-\\><C-n><C-w>5+', {})
vim.keymap.set('t', '<C-M-I>', '<C-\\><C-n><C-w>5-', {})
vim.keymap.set('t', '<C-M-O>', '<C-\\><C-n><C-w>5>', {})
vim.keymap.set('n', '<leader>s', ':call WindowSwap#EasyWindowSwap()<CR>', {}) vim.keymap.set('n', '<leader>s', ':call WindowSwap#EasyWindowSwap()<CR>', {})
-- Convenience -- Convenience
vim.keymap.set('n', '<leader>w', ':w<CR>', { silent = true }) vim.keymap.set('n', '<leader>w', ':w<CR>', { silent = true })
vim.keymap.set('n', '<leader>F', ':e.<CR>', {}) vim.keymap.set('n', '<leader>F', ':NvimTreeToggle<CR>', { noremap = true, silent = true })
vim.keymap.set('n', 'Y', 'y$', {}) vim.keymap.set('n', 'Y', 'y$', {})
-- Telescope -- Telescope
@@ -26,6 +37,62 @@ vim.keymap.set('n', '<leader>fs', telebuiltin.grep_string, { silent = true })
vim.keymap.set('n', '<leader>o', telebuiltin.buffers, { silent = true }) vim.keymap.set('n', '<leader>o', telebuiltin.buffers, { silent = true })
vim.keymap.set('n', '<leader>fh', telebuiltin.help_tags, { silent = true }) vim.keymap.set('n', '<leader>fh', telebuiltin.help_tags, { silent = true })
-- Code
vim.keymap.set('n', '<leader>cs', '<cmd>Trouble symbols toggle focus=true win.position=right<cr>')
vim.keymap.set('n', '<leader>cl', '<cmd>Trouble lsp toggle focus=true win.position=right<cr>')
vim.keymap.set('n', '<leader>cd', '<cmd>Trouble diagnostics toggle focus=true win.position=bottom<cr>')
vim.keymap.set('n', '<leader>cq', '<cmd>Trouble quickfix toggle focus=true win.position=bottom<cr>')
vim.keymap.set('n', '<leader>cr', vim.lsp.buf.rename, { desc = 'LSP Rename' })
vim.keymap.set('n', '<leader>ct', vim.lsp.buf.type_definition, { desc = 'LSP Type Definition' })
vim.keymap.set('n', '<leader>cF', require("conform").format, { desc = 'LSP Format' })
vim.keymap.set('n', '<leader>cgi', vim.lsp.buf.implementation, { desc = 'LSP Implementation' })
vim.keymap.set('n', '<leader>cgd', vim.lsp.buf.definition, { desc = 'LSP Definition' })
vim.keymap.set('n', '<leader>cgD', vim.lsp.buf.declaration, { desc = 'LSP Declaration' })
vim.keymap.set('n', '<leader>cwa', vim.lsp.buf.add_workspace_folder, { desc = 'LSP Add Workspace Folder' })
vim.keymap.set('n', '<leader>cwl', vim.lsp.buf.list_workspace_folders, { desc = 'LSP List Workspace Folders' })
vim.keymap.set('n', '<leader>cwr', vim.lsp.buf.remove_workspace_folder, { desc = 'LSP Remove Workspace Folder' })
vim.keymap.set('n', '<leader>cws', vim.lsp.buf.workspace_symbol, { desc = 'LSP Workspace Symbol' })
vim.keymap.set('n', '<leader>ch', vim.lsp.buf.hover, { desc = 'LSP Hover' })
vim.keymap.set('n', '<leader>cH', vim.lsp.buf.signature_help, { desc = 'LSP Signature Help' })
vim.keymap.set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, { desc = 'LSP Code Action' })
vim.keymap.set('n', '<leader>cde', ToggleDiagnostics, { desc = 'Toggle Diagnostics' })
vim.keymap.set('n', '<leader>cf',
function()
local word = vim.fn.expand("<cword>")
require('telescope.builtin').live_grep({
default_text = word,
})
end
)
vim.keymap.set('v', '<leader>cf',
function()
require('telescope.builtin').grep_string()
end
)
-- Copilot
local cop = require('copilot.panel')
local cos = require('copilot.suggestion')
vim.keymap.set('n', '<leader>ap', cop.toggle)
vim.keymap.set('n', '<leader>apn', cop.jump_next)
vim.keymap.set('n', '<leader>app', cop.jump_prev)
vim.keymap.set('n', '<leader>apr', cop.refresh)
-- vim.keymap.set('n', '<leader>as', cos.accept)
-- vim.keymap.set('n', '<leader>ast', cos.toggle_auto_trigger)
-- vim.keymap.set('n', '<leader>asl', cos.accept_word)
-- vim.keymap.set('n', '<leader>asw', cos.accept_line)
-- vim.keymap.set('n', '<leader>asn', cos.next)
-- vim.keymap.set('n', '<leader>asp', cos.prev)
-- vim.keymap.set('n', '<leader>asd', cos.dismiss)
vim.keymap.set('n', '<leader>ac', '<cmd>CopilotChatToggle<cr>')
vim.keymap.set('n', '<leader>acs', '<cmd>CopilotChatStop<cr>')
vim.keymap.set('n', '<leader>acr', '<cmd>CopilotChatReset<cr>')
vim.keymap.set('n', '<leader>acm', '<cmd>CopilotChatModels<cr>')
vim.keymap.set('n', '<leader>acp', '<cmd>CopilotChatPrompts<cr>')
-- Yanky -- Yanky
vim.keymap.set({"n","x"}, "p", "<Plug>(YankyPutAfter)") vim.keymap.set({"n","x"}, "p", "<Plug>(YankyPutAfter)")
vim.keymap.set({"n","x"}, "P", "<Plug>(YankyPutBefore)") vim.keymap.set({"n","x"}, "P", "<Plug>(YankyPutBefore)")
@@ -38,5 +105,27 @@ vim.keymap.set({"n","x"}, "y", "<Plug>(YankyYank)")
-- Undotree -- Undotree
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle) vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle)
-- nnoremap <silent> <leader>t :CtrlPBufTagAll<CR> -- DAP
-- nnoremap <silent> <leader>T :TagbarToggle<CR> vim.keymap.set('n', "<Leader>db", function() require("dap").toggle_breakpoint() end)
vim.keymap.set('n', "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end)
vim.keymap.set('n', "<leader>dc", function() require("dap").continue() end)
vim.keymap.set('n', "<leader>da", function() require("dap").continue({ before = get_args }) end)
vim.keymap.set('n', "<leader>dC", function() require("dap").run_to_cursor() end)
vim.keymap.set('n', "<leader>dg", function() require("dap").goto_() end)
vim.keymap.set('n', "<leader>di", function() require("dap").step_into() end)
vim.keymap.set('n', "<leader>dj", function() require("dap").down() end)
vim.keymap.set('n', "<leader>dk", function() require("dap").up() end)
vim.keymap.set('n', "<leader>dl", function() require("dap").run_last() end)
vim.keymap.set('n', "<leader>do", function() require("dap").step_over() end)
vim.keymap.set('n', "<leader>dO", function() require("dap").step_out() end)
vim.keymap.set('n', "<leader>dP", function() require("dap").pause() end)
vim.keymap.set('n', "<leader>dr", function() require("dap").repl.toggle() end)
vim.keymap.set('n', "<leader>ds", function() require("dap").session() end)
vim.keymap.set('n', "<leader>dt", function() require("dap").terminate() end)
vim.keymap.set('n', "<leader>dw", function() require("dap.ui.widgets").hover() end)
vim.keymap.set('n', "<F5>", function() require("dap").continue() end)
vim.keymap.set('n', "<F11>", function() require("dap").step_into() end)
vim.keymap.set('n', "<F10>", function() require("dap").step_over() end)
vim.keymap.set('n', "<F12>", function() require("dap").step_out() end)

View File

@@ -1,5 +1,18 @@
vim.g.delimitMate_expand_space=1 -- vim.g.delimitMate_expand_space=1
vim.g.delimitMate_expand_cr = 1 -- vim.g.delimitMate_expand_cr = 1
require('mini.pairs').setup()
require('mini.align').setup()
require('mini.bracketed').setup()
require('mini.splitjoin').setup()
require('mini.move').setup()
require('mini.move').setup()
require('flash').setup()
require('ts-comments').setup()
local function is_wsl_env()
return os.getenv("WSL_DISTRO_NAME") ~= nil or os.getenv("WSL_INTEROP") ~= nil
end
vim.g.tagbar_left=1 vim.g.tagbar_left=1
vim.g.tagbar_autoclose=1 vim.g.tagbar_autoclose=1
@@ -9,11 +22,12 @@ vim.g.windowswap_map_keys=0
local cmp = require('cmp') local cmp = require('cmp')
local lspkind = require('lspkind') local lspkind = require('lspkind')
local ls = require('luasnip')
cmp.setup({ cmp.setup({
snippet = { snippet = {
expand = function(args) expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. ls.lsp_expand(args.body)
end, end,
}, },
@@ -22,23 +36,60 @@ cmp.setup({
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
}, },
mapping = cmp.mapping.preset.insert({ -- mapping = cmp.mapping.preset.insert({
-- -- ['<Tab>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
-- }),
mapping = {
['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(), ['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. ['<CR>'] = cmp.mapping(function(fallback)
}), if cmp.visible() then
if cmp.get_selected_entry() then
if ls.expandable() then
ls.expand()
else
cmp.confirm({
select = false,
})
end
else
fallback()
end
else
fallback()
end
end),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif ls.locally_jumpable(1) then
ls.jump(1)
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif ls.locally_jumpable(-1) then
ls.jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp', priority = 1000 },
{ name = 'vsnip' }, { name = 'buffer', priority = 800, keyword_length = 2 },
{ name = 'path' }, { name = 'copilot', priority = 700 },
{ name = 'cmp_yanky' }, { name = 'path', priority = 600 },
{ name = 'git' }, { name = 'cmp_yanky', priority = 500 },
{ name = 'copilot' }, { name = 'git', priority = 400 },
-- }, { { name = 'luasnip', priority = 300 },
{ name = 'buffer', keyword_length = 2 }, { name = 'nvim_lua', priority = 200 },
}), }),
formatting = { formatting = {
@@ -87,20 +138,22 @@ cmp.setup.cmdline(':', {
}) })
local capabilities = require('cmp_nvim_lsp').default_capabilities() local capabilities = require('cmp_nvim_lsp').default_capabilities()
local lspconfig = require("lspconfig")
lspconfig.gopls.setup({ capabilities = capabilities }) capabilities.textDocument.foldingRange = {
lspconfig.svelte.setup({ capabilities = capabilities }) dynamicRegistration = false,
lspconfig.pyright.setup({ capabilities = capabilities }) lineFoldingOnly = true
lspconfig.omnisharp.setup({ capabilities = capabilities }) }
lspconfig.clangd.setup({ capabilities = capabilities })
lspconfig.dockerls.setup({ capabilities = capabilities }) local language_servers = vim.lsp.get_clients() -- or list servers manually like {'gopls', 'clangd'}
lspconfig.docker_compose_language_service.setup({ capabilities = capabilities }) for _, ls in ipairs(language_servers) do
lspconfig.flow.setup({ capabilities = capabilities }) if ls ~= nil then
lspconfig.marksman.setup({ capabilities = capabilities }) vim.lsp.config(ls).setup({
lspconfig.als.setup({ capabilities = capabilities }) capabilities = capabilities
lspconfig.sqls.setup({ capabilities = capabilities }) -- you can add other fields for setting up lsp server in this table
lspconfig.yamlls.setup({ capabilities = capabilities }) })
lspconfig.nil_ls.setup({ capabilities = capabilities }) end
end
require('ufo').setup()
require("yanky").setup({ require("yanky").setup({
ring = { ring = {
@@ -117,29 +170,38 @@ require("yanky").setup({
}, },
}) })
require("telescope").setup {
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown {
}
}
}
}
require("telescope").load_extension("ui-select")
require("telescope").load_extension("yank_history") require("telescope").load_extension("yank_history")
require'nvim-treesitter.configs'.setup { -- require'nvim-treesitter.configs'.setup {
-- ensure_installed = { "lua", "vim", "help" }, -- -- ensure_installed = { "lua", "vim", "help" },
ensure_installed = {}, -- ensure_installed = {},
sync_install = false, -- sync_install = false,
auto_install = false, -- auto_install = false,
--
--
highlight = { -- highlight = {
enable = true, -- enable = true,
--
disable = function(lang, buf) -- disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB -- local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) -- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then -- if ok and stats and stats.size > max_filesize then
return true -- return true
end -- end
end, -- end,
--
additional_vim_regex_highlighting = false, -- additional_vim_regex_highlighting = false,
}, -- },
} -- }
require('lualine').setup({ require('lualine').setup({
options = { options = {
@@ -153,7 +215,7 @@ require('lualine').setup({
}, },
ignore_focus = {}, ignore_focus = {},
always_divide_middle = true, always_divide_middle = true,
globalstatus = false, globalstatus = true,
refresh = { refresh = {
statusline = 1000, statusline = 1000,
tabline = 1000, tabline = 1000,
@@ -188,3 +250,231 @@ require("copilot").setup({
panel = { enabled = false }, panel = { enabled = false },
}) })
require("copilot_cmp").setup() require("copilot_cmp").setup()
require("CopilotChat").setup {
model = 'claude-3.7-sonnet',
}
vim.g.bullets_enabled_file_types = {
'markdown',
'text',
'gitcommit',
'scratch'
}
require("nvim-tree").setup({
sort = {
sorter = "case_sensitive",
},
view = {
width = 30,
},
renderer = {
group_empty = true,
},
-- filters = {
-- dotfiles = true,
-- },
})
require('gitsigns').setup {
signs = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signs_staged = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signs_staged_enable = true,
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
follow_files = true
},
auto_attach = true,
attach_to_untracked = false,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
virt_text_priority = 100,
use_focus = true,
},
current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
},
}
require("conform").setup({
formatters_by_ft = {
python = {"ruff_fix", "ruff_format", "ruff_organize_imports", lsp_format = "fallback"},
rust = {"rustfmt", lsp_format = "fallback"},
go = {"gofmt", "goimports", lsp_format = "fallback"},
lua = { "stylua", lsp_format = "fallback"},
},
})
require('lint').linters_by_ft = {
markdown = {'vale'},
}
require("trouble").setup()
require("todo-comments").setup()
require("dapui").setup()
require("nvim-dap-virtual-text").setup()
local dap, dapui = require("dap"), require("dapui")
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end
dap.adapters.codelldb = {
type = 'server',
port = "${port}",
executable = {
command = "codelldb",
args = {"--port", "${port}"},
}
}
dap.configurations.zig = {
{
name = "Launch Zig Program",
type = "codelldb",
request = "launch",
program = function()
-- Prompts for the executable path when you start debugging
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/zig-out/bin/', 'file')
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
},
}
if vim.fn.has("mac") then
workspaces = {
{
name = "privat",
path = "~/Documents/notes/privat",
},
{
name = "joplin",
path = "~/Documents/notes/fromjoplin",
},
}
daily_notes = {
folder = "Journal",
date_format = "%Y-%m-%d",
default_tags = { "journal" },
template = "daily.md"
}
end
if is_wsl_env() then
workspaces = {
{
name = "work",
path = "/mnt/c/Users/marti/Documents/notes/Work",
},
{
name = "privat",
path = "/mnt/c/Users/marti/Documents/notes/privat",
},
}
daily_notes = {}
end
require("obsidian").setup({
workspaces = workspaces,
templates = {
folder = "_templates",
date_format = "%Y-%m-%d %a",
time_format = "%H:%M",
},
checkbox = {
order = { " ", ">", "x", "!", "~" },
},
frontmatter = {
enabled = true,
func = function(note)
-- Add the title of the note as an alias.
if note.title then
note:add_alias(note.title)
end
local out = { id = note.id, tags = note.tags }
if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then
for k, v in pairs(note.metadata) do
out[k] = v
end
end
return out
end,
},
note_path_func = function(spec)
local path = spec.dir / spec.title
return path:with_suffix(".md")
end,
daily_notes = daily_notes,
legacy_commands = false,
})
require('render-markdown').setup({
enabled = true,
file_types = { 'markdown'},
completions = { lsp = { enabled = true } },
render_modes = { 'n', 'c', 't' },
checkbox = {
enabled = true,
render_modes = false,
bullet = false,
right_pad = 1,
unchecked = {
icon = '󰄱 ',
highlight = 'RenderMarkdownUnchecked',
scope_highlight = nil,
},
checked = {
icon = '󰱒 ',
highlight = 'RenderMarkdownChecked',
scope_highlight = nil,
},
custom = {
next = { raw = '[!]', rendered = '', highlight = 'RenderMarkdownNext', scope_highlight = nil },
ongoing = { raw = '[>]', rendered = '', highlight = 'RenderMarkdownOngoing', scope_highlight = nil },
waiting = { raw = '[~]', rendered = '󰥔 ', highlight = 'RenderMarkdownWaiting', scope_highlight = nil },
},
},
})