Compare commits
24 Commits
work
...
38083b9af4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38083b9af4 | ||
|
|
9b0b1f76f9 | ||
|
|
4460f57073 | ||
|
|
2fbabfb771 | ||
|
|
6250ccbf11 | ||
|
|
65cc61773f | ||
|
|
eb1c83806d | ||
|
|
0f534320a7 | ||
|
|
05c7d3443a | ||
|
|
95dd2b7e5f | ||
|
|
cc6b13faf5 | ||
|
|
3d45b378ca | ||
|
|
cda09842fd | ||
|
|
976ff60cc6 | ||
|
|
980d2f8c73 | ||
|
|
b7b64049a3 | ||
|
|
bd3e120fb0 | ||
|
|
3bdd7e1c50 | ||
|
|
61bb1578e0 | ||
|
|
a9c5e2398d | ||
|
|
f4d15c3d1b | ||
|
|
28f2042ad0 | ||
|
|
84ad11d543 | ||
|
|
a81bae3a85 |
206
MIGRATION.md
206
MIGRATION.md
@@ -1,206 +0,0 @@
|
|||||||
# 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
107
QUICK_START.md
@@ -1,107 +0,0 @@
|
|||||||
# 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
|
|
||||||
352
README.md
352
README.md
@@ -1,282 +1,130 @@
|
|||||||
# NixOS-WSL Configuration for pan
|
# Unified Nix Configuration
|
||||||
|
|
||||||
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.
|
This repository contains a modular, flake-based Nix configuration for multiple platforms and hosts. It provides a declarative and reproducible environment using NixOS, nix-darwin, and Home Manager.
|
||||||
|
|
||||||
|
## Quick Start Guide
|
||||||
|
|
||||||
|
### Daily Usage
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Apply changes (NixOS WSL)
|
||||||
|
nixos-rebuild switch --sudo --flake .#work --impure
|
||||||
|
|
||||||
|
# Apply changes (macOS)
|
||||||
|
darwin-rebuild switch --flake .#Martins-MacBook-Pro
|
||||||
|
|
||||||
|
# Update packages (weekly/monthly)
|
||||||
|
nix flake update
|
||||||
|
# ... then run the switch command for your host
|
||||||
|
```
|
||||||
|
|
||||||
## Structure
|
## Structure
|
||||||
|
|
||||||
|
The configuration is organized into `hosts` and `modules`:
|
||||||
|
|
||||||
```
|
```
|
||||||
nixos/
|
.
|
||||||
├── flake.nix # Flake with nixos-unstable, nixos-wsl, home-manager
|
├── flake.nix # Entry point with all system configurations
|
||||||
├── flake.lock # Locked dependency versions (auto-generated)
|
├── flake.lock # Locked dependency versions
|
||||||
├── configuration.nix # System-level NixOS-WSL configuration
|
├── hosts/ # Machine-specific configurations
|
||||||
├── home.nix # Home Manager user configuration
|
│ ├── home/
|
||||||
├── modules/ # User-level module configurations
|
│ │ ├── darwin/ # Martins-MacBook-Pro
|
||||||
│ ├── sh.nix # Shell (Zsh with Prezto, fzf, zoxide)
|
│ │ ├── nix/ # Standalone Home Manager for Home
|
||||||
│ ├── tmux.nix # Tmux configuration
|
│ │ └── nixos/ # Home NixOS Server
|
||||||
│ ├── git.nix # Git, Lazygit, Jujutsu
|
│ └── work/
|
||||||
│ ├── nvim.nix # Neovim with 40+ plugins
|
│ ├── nix/ # Standalone Home Manager for Work
|
||||||
│ ├── dev.nix # Development tools
|
│ └── nixos/ # Work NixOS (WSL)
|
||||||
│ └── task.nix # Taskwarrior, Timewarrior
|
└── modules/ # Shared reusable modules
|
||||||
├── README.md # This file
|
├── home/ # Home Manager modules (sh, nvim, tmux, etc.)
|
||||||
├── TODO.md # Known issues and future work
|
└── nixos/ # NixOS-specific modules
|
||||||
├── SUMMARY.md # Implementation overview
|
|
||||||
└── MIGRATION.md # Guide for migrating from channels to flakes
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Installation
|
## Available Configurations
|
||||||
|
|
||||||
### 1. Test the Configuration (Recommended First Step)
|
### NixOS
|
||||||
|
- **work**: WSL-based NixOS environment for work (User: `pan`).
|
||||||
|
- **home**: Server-based NixOS environment for home (User: `martin`).
|
||||||
|
|
||||||
Before applying, validate and test build:
|
### Darwin (macOS)
|
||||||
|
- **Martins-MacBook-Pro**: nix-darwin configuration for macOS.
|
||||||
|
|
||||||
|
### Standalone Home Manager
|
||||||
|
- **pan@work**: Home Manager for non-NixOS Linux at work.
|
||||||
|
- **martin@mac**: Home Manager for macOS (without nix-darwin).
|
||||||
|
|
||||||
|
## Installation & Usage
|
||||||
|
|
||||||
|
### 1. Apply Configuration
|
||||||
|
|
||||||
|
Navigate to the repository and run the appropriate command for your system:
|
||||||
|
|
||||||
|
**NixOS (Work/WSL):**
|
||||||
|
```bash
|
||||||
|
sudo nixos-rebuild switch --flake .#work --impure
|
||||||
|
```
|
||||||
|
|
||||||
|
**Darwin (macOS):**
|
||||||
|
```bash
|
||||||
|
darwin-rebuild switch --flake .#Martins-MacBook-Pro
|
||||||
|
```
|
||||||
|
|
||||||
|
**Standalone Home Manager:**
|
||||||
|
```bash
|
||||||
|
home-manager switch --flake .#pan@work
|
||||||
|
```
|
||||||
|
|
||||||
|
*Note: The `--impure` flag may be required for certain configurations (like NIX_LD).*
|
||||||
|
|
||||||
|
### 2. Updating System Packages
|
||||||
|
|
||||||
|
To update all packages to the latest versions from nixpkgs-unstable:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /home/pan/dev/config/dot/nix/nixos
|
# Update flake inputs
|
||||||
|
|
||||||
# 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
|
nix flake update
|
||||||
|
|
||||||
# Apply the updates
|
# Apply the updates
|
||||||
sudo nixos-rebuild switch --flake .#nix --impure
|
sudo nixos-rebuild switch --flake .#work --impure
|
||||||
```
|
```
|
||||||
|
|
||||||
View what changed:
|
## Maintenance
|
||||||
```bash
|
|
||||||
git diff flake.lock # See version bumps
|
|
||||||
```
|
|
||||||
|
|
||||||
## Rollback
|
### Rollback
|
||||||
|
If something breaks after an update, you can rollback to the previous generation:
|
||||||
### Rollback to Previous Generation
|
- **NixOS**: `sudo nixos-rebuild switch --rollback`
|
||||||
|
- **Darwin**: `darwin-rebuild --rollback`
|
||||||
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
|
|
||||||
|
|
||||||
|
### Cleanup
|
||||||
Remove old generations to free up disk space:
|
Remove old generations to free up disk space:
|
||||||
```bash
|
```bash
|
||||||
# Delete generations older than 30 days
|
# Delete generations older than 30 days
|
||||||
sudo nix-collect-garbage --delete-older-than 30d
|
sudo nix-collect-garbage --delete-older-than 30d
|
||||||
|
|
||||||
# Or delete all old generations except current
|
# Or delete all old generations
|
||||||
sudo nix-collect-garbage -d
|
sudo nix-collect-garbage -d
|
||||||
```
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
## Modules Detail
|
||||||
|
|
||||||
### Build Fails
|
### Home Manager Modules (`modules/home/`)
|
||||||
|
- **sh.nix**: Zsh configuration with completions and aliases.
|
||||||
|
- **nvim.nix**: Personalized Neovim setup.
|
||||||
|
- **tmux.nix**: Terminal multiplexer configuration.
|
||||||
|
- **git.nix**: Git, Lazygit, and Jujutsu settings.
|
||||||
|
- **dev.nix**: Development tools, language runtimes, and LLM tool configurations.
|
||||||
|
- **task.nix**: Taskwarrior and productivity tools.
|
||||||
|
|
||||||
|
### NixOS Modules (`modules/nixos/`)
|
||||||
|
- **common.nix**: Shared system settings for all NixOS hosts.
|
||||||
|
|
||||||
|
## Create Convenience Alias
|
||||||
|
|
||||||
|
Add these to your shell configuration for faster updates:
|
||||||
|
|
||||||
Check for syntax errors:
|
|
||||||
```bash
|
```bash
|
||||||
nix flake check
|
# Quick rebuild (adjust to your host)
|
||||||
|
alias nr='sudo nixos-rebuild switch --flake .#work --impure'
|
||||||
|
|
||||||
|
# Update and rebuild
|
||||||
|
alias nu='nix flake update && sudo nixos-rebuild switch --flake .#work --impure'
|
||||||
```
|
```
|
||||||
|
|
||||||
### 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
180
SUMMARY.md
@@ -1,180 +0,0 @@
|
|||||||
# 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! 🚀
|
|
||||||
52
TODO.md
52
TODO.md
@@ -12,32 +12,10 @@ This file tracks remaining tasks and known issues for the NixOS configuration.
|
|||||||
- Adjust CPU microcode (Intel vs AMD)
|
- Adjust CPU microcode (Intel vs AMD)
|
||||||
|
|
||||||
### System Settings
|
### 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)
|
- [ ] Choose boot loader (systemd-boot vs GRUB)
|
||||||
|
|
||||||
## Medium Priority
|
## 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
|
### Tmux Configuration
|
||||||
|
|
||||||
- [ ] Update note popup keybindings (C-n, C-p) with correct NixOS paths
|
- [ ] Update note popup keybindings (C-n, C-p) with correct NixOS paths
|
||||||
@@ -101,16 +79,16 @@ initLua = builtins.concatStringsSep "\n" [
|
|||||||
|
|
||||||
### Profile Loading
|
### Profile Loading
|
||||||
|
|
||||||
The shell configuration includes:
|
The shell configuration is now configurable via `dot.sh.sourceProfile`:
|
||||||
```nix
|
```nix
|
||||||
profileExtra = ''
|
profileExtra = lib.mkIf cfg.sourceProfile ''
|
||||||
source $HOME/.profile
|
source $HOME/.profile
|
||||||
'';
|
'';
|
||||||
```
|
```
|
||||||
|
|
||||||
**Status**: Will fail silently if `~/.profile` doesn't exist
|
**Status**: Disabled by default. Only enabled for work host.
|
||||||
|
|
||||||
**Action**: Either create `~/.profile` or remove this line if not needed
|
**Action**: Verify `~/.profile` exists on hosts where `dot.sh.sourceProfile = true` is set.
|
||||||
|
|
||||||
## Testing Checklist
|
## Testing Checklist
|
||||||
|
|
||||||
@@ -144,23 +122,21 @@ Before considering this configuration complete:
|
|||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
### Differences from Ubuntu Setup
|
### Unified Structure Benefits
|
||||||
|
|
||||||
1. **No macOS support**: All Darwin-specific code removed
|
1. **Multi-platform support**: Added support for Darwin (macOS) and NixOS (WSL and native).
|
||||||
2. **No WSL support**: WSL-specific paths and checks removed
|
2. **Modular Home Manager**: Reusable modules shared across all platforms.
|
||||||
3. **System-level user**: User defined in NixOS config, not standalone
|
3. **Machine-specific configurations**: Separated into `hosts/` for better organization.
|
||||||
4. **Integrated Home Manager**: HM runs as NixOS module, not standalone
|
4. **Flexible deployment**: Support for both NixOS modules and standalone Home Manager.
|
||||||
|
|
||||||
### Migration Path
|
### Migration Path
|
||||||
|
|
||||||
If migrating from existing Ubuntu setup:
|
This configuration is designed to be the central point for all machines:
|
||||||
|
|
||||||
1. Backup current configuration
|
1. Clone to `~/dev/dot/newnix` (or preferred path).
|
||||||
2. Install NixOS (keep Ubuntu if dual-boot)
|
2. Identify your host type (NixOS WSL, Darwin, etc.).
|
||||||
3. Apply this configuration
|
3. Apply the corresponding flake output as described in `README.md`.
|
||||||
4. Test all workflows
|
4. Test and verify workflows.
|
||||||
5. Import personal data (tasks, notes, etc.)
|
|
||||||
6. Verify custom packages availability
|
|
||||||
|
|
||||||
## Questions to Resolve
|
## Questions to Resolve
|
||||||
|
|
||||||
|
|||||||
309
flake.lock
generated
Normal file
309
flake.lock
generated
Normal file
@@ -0,0 +1,309 @@
|
|||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681202837,
|
||||||
|
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_2": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731533236,
|
||||||
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-stable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1770260404,
|
||||||
|
"narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "release-25.11",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"home-manager-wsl": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-wsl-stable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1763992789,
|
||||||
|
"narHash": "sha256-WHkdBlw6oyxXIra/vQPYLtqY+3G8dUVZM8bEXk0t8x4=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "44831a7eaba4360fb81f2acc5ea6de5fde90aaa3",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "release-25.05",
|
||||||
|
"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-vscode-server": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1770124655,
|
||||||
|
"narHash": "sha256-yHmd2B13EtBUPLJ+x0EaBwNkQr9LTne1arLVxT6hSnY=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixos-vscode-server",
|
||||||
|
"rev": "92ce71c3ba5a94f854e02d57b14af4997ab54ef0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixos-vscode-server",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixos-wsl": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-wsl-stable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1770657009,
|
||||||
|
"narHash": "sha256-v/LA5ZSJ+JQYzMSKB4sySM0wKfsAqddNzzxLLnbsV/E=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "NixOS-WSL",
|
||||||
|
"rev": "5b50ea1aaa14945d4794c80fcc99c4aa1db84d2d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "NixOS-WSL",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1770562336,
|
||||||
|
"narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "d6c71932130818840fc8fe9509cf50be8c64634f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-stable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1770617025,
|
||||||
|
"narHash": "sha256-1jZvgZoAagZZB6NwGRv2T2ezPy+X6EFDsJm+YSlsvEs=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "2db38e08fdadcc0ce3232f7279bab59a15b94482",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-25.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-wsl-stable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1767313136,
|
||||||
|
"narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-25.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1770197578,
|
||||||
|
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"id": "nixpkgs",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"type": "indirect"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"home-manager": "home-manager",
|
||||||
|
"home-manager-wsl": "home-manager-wsl",
|
||||||
|
"nix-darwin": "nix-darwin",
|
||||||
|
"nixos-vscode-server": "nixos-vscode-server",
|
||||||
|
"nixos-wsl": "nixos-wsl",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable",
|
||||||
|
"nixpkgs-wsl-stable": "nixpkgs-wsl-stable",
|
||||||
|
"sops-nix": "sops-nix",
|
||||||
|
"tasksquire": "tasksquire"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sops-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1770683991,
|
||||||
|
"narHash": "sha256-xVfPvXDf9QN3Eh9dV+Lw6IkWG42KSuQ1u2260HKvpnc=",
|
||||||
|
"owner": "Mic92",
|
||||||
|
"repo": "sops-nix",
|
||||||
|
"rev": "8b89f44c2cc4581e402111d928869fe7ba9f7033",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Mic92",
|
||||||
|
"repo": "sops-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tasksquire": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils_2",
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1770735271,
|
||||||
|
"narHash": "sha256-Vt1di5EUPq6ijBX0h8aaRVnSkCDpI5Myd2tXjQlK3Tw=",
|
||||||
|
"ref": "dev",
|
||||||
|
"rev": "6e606985267d438f6d30a117863812347960694b",
|
||||||
|
"revCount": 48,
|
||||||
|
"type": "git",
|
||||||
|
"url": "ssh://git@git.pander.me/martin/tasksquire.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"ref": "dev",
|
||||||
|
"type": "git",
|
||||||
|
"url": "ssh://git@git.pander.me/martin/tasksquire.git"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
149
flake.nix
Normal file
149
flake.nix
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
{
|
||||||
|
description = "Unified Nix Configuration";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
# Unstable for standalone configurations and overlays
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
|
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||||
|
|
||||||
|
nixpkgs-wsl-stable.url = "github:nixos/nixpkgs/nixos-25.05";
|
||||||
|
|
||||||
|
nixos-wsl = {
|
||||||
|
url = "github:nix-community/NixOS-WSL";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs-wsl-stable";
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager/release-25.11";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs-stable";
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager-wsl = {
|
||||||
|
url = "github:nix-community/home-manager/release-25.05";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs-wsl-stable";
|
||||||
|
};
|
||||||
|
|
||||||
|
nix-darwin = {
|
||||||
|
url = "github:LnL7/nix-darwin";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
# individual packages
|
||||||
|
sops-nix = {
|
||||||
|
url = "github:Mic92/sops-nix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
nixos-vscode-server = {
|
||||||
|
url = "github:nix-community/nixos-vscode-server";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
tasksquire = {
|
||||||
|
url = "git+ssh://git@git.pander.me/martin/tasksquire.git?ref=dev";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, nixpkgs-stable, nixpkgs-wsl-stable, nixos-wsl, home-manager, home-manager-wsl, 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
|
||||||
|
"nixos@work" = nixpkgs-wsl-stable.lib.nixosSystem {
|
||||||
|
specialArgs = { inherit self inputs; };
|
||||||
|
modules = [
|
||||||
|
nixos-wsl.nixosModules.wsl
|
||||||
|
./hosts/work/nixos/configuration.nix
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
nixpkgs.hostPlatform = linuxSystem;
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
nixpkgs.overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ];
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.extraSpecialArgs = {
|
||||||
|
inherit self inputs;
|
||||||
|
};
|
||||||
|
home-manager.users.pan = import ./hosts/work/nixos/home.nix;
|
||||||
|
}
|
||||||
|
inputs.nixos-vscode-server.nixosModules.default
|
||||||
|
({ pkgs, ... }: {
|
||||||
|
services.vscode-server.enable = true;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Home
|
||||||
|
"nixos@home" = nixpkgs-stable.lib.nixosSystem {
|
||||||
|
specialArgs = {
|
||||||
|
inherit self inputs;
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
./hosts/home/nixos/configuration.nix
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
nixpkgs.hostPlatform = linuxAarchSystem;
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
nixpkgs.overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ];
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.extraSpecialArgs = {
|
||||||
|
inherit self inputs;
|
||||||
|
};
|
||||||
|
home-manager.users.martin = import ./hosts/home/nixos/home.nix;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# --- Darwin Systems (Mac) ---
|
||||||
|
darwinConfigurations."Martins-MacBook-Pro" = nix-darwin.lib.darwinSystem {
|
||||||
|
specialArgs = { inherit self inputs; };
|
||||||
|
modules = [
|
||||||
|
./hosts/home/darwin/configuration.nix
|
||||||
|
{
|
||||||
|
nixpkgs.hostPlatform = darwinSystem;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# --- Standalone Home Manager ---
|
||||||
|
homeConfigurations = {
|
||||||
|
"nix@work" = home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = nixpkgs-stable.legacyPackages.${linuxSystem};
|
||||||
|
extraSpecialArgs = { inherit self inputs; };
|
||||||
|
modules = [
|
||||||
|
./hosts/work/nix/home.nix
|
||||||
|
{
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
nixpkgs.overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
"nix@home" = home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = nixpkgs-stable.legacyPackages.${darwinSystem};
|
||||||
|
extraSpecialArgs = { inherit self inputs; };
|
||||||
|
modules = [
|
||||||
|
./hosts/home/nix/home.nix
|
||||||
|
{
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
nixpkgs.overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -2,14 +2,9 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../../modules/home/common.nix
|
../../modules/home/common.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
home.username = "martin";
|
|
||||||
home.homeDirectory = "/Users/martin";
|
|
||||||
|
|
||||||
home.stateVersion = "24.05";
|
|
||||||
|
|
||||||
programs.git.settings.user = {
|
programs.git.settings.user = {
|
||||||
name = "Martin Pander";
|
name = "Martin Pander";
|
||||||
email = "git@pander-on.de";
|
email = "git@pander-on.de";
|
||||||
@@ -19,4 +14,9 @@
|
|||||||
name = "Martin Pander";
|
name = "Martin Pander";
|
||||||
email = "git@pander-on.de";
|
email = "git@pander-on.de";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dot.llm = {
|
||||||
|
enable = true;
|
||||||
|
gemini-cli.enable = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
12
hosts/home/nix/home.nix
Normal file
12
hosts/home/nix/home.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../common.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
home.username = "martin";
|
||||||
|
home.homeDirectory = "/Users/martin";
|
||||||
|
|
||||||
|
home.stateVersion = "24.05";
|
||||||
|
}
|
||||||
@@ -24,5 +24,9 @@
|
|||||||
|
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.ghostty.terminfo
|
||||||
|
];
|
||||||
|
|
||||||
system.stateVersion = "25.11";
|
system.stateVersion = "25.11";
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../../modules/home/common.nix
|
../common.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# User details
|
# User details
|
||||||
@@ -2,15 +2,9 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../../modules/home/common.nix
|
../../modules/home/common.nix
|
||||||
../../../modules/home/llm.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
home.username = "pan";
|
|
||||||
home.homeDirectory = "/home/pan";
|
|
||||||
|
|
||||||
home.stateVersion = "23.11";
|
|
||||||
|
|
||||||
programs.git.settings.user = {
|
programs.git.settings.user = {
|
||||||
name = "Martin Pander";
|
name = "Martin Pander";
|
||||||
email = "martin.pander@knowtion.de";
|
email = "martin.pander@knowtion.de";
|
||||||
@@ -21,8 +15,12 @@
|
|||||||
email = "martin.pander@knowtion.de";
|
email = "martin.pander@knowtion.de";
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.zsh.profileExtra = ''
|
dot.llm = {
|
||||||
source $HOME/.profile
|
enable = true;
|
||||||
'';
|
claude-code.enable = true;
|
||||||
|
opencode.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
dot.tmux.workMode = true;
|
||||||
|
dot.nvim.workMode = true;
|
||||||
}
|
}
|
||||||
19
hosts/work/nix/home.nix
Normal file
19
hosts/work/nix/home.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../common.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
home.username = "pan";
|
||||||
|
home.homeDirectory = "/home/pan";
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
nix-ld
|
||||||
|
];
|
||||||
|
|
||||||
|
home.stateVersion = "23.11";
|
||||||
|
|
||||||
|
dot.sh.sourceProfile = true;
|
||||||
|
|
||||||
|
}
|
||||||
17
hosts/work/nixos/home.nix
Normal file
17
hosts/work/nixos/home.nix
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../common.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# User details
|
||||||
|
home.username = "pan";
|
||||||
|
home.homeDirectory = "/home/pan";
|
||||||
|
|
||||||
|
# Home Manager release version
|
||||||
|
home.stateVersion = "25.05";
|
||||||
|
|
||||||
|
# Disable version mismatch warning (intentionally using HM 25.11 with nixpkgs 25.05)
|
||||||
|
home.enableNixpkgsReleaseCheck = false;
|
||||||
|
}
|
||||||
59
modules/home/common.nix
Normal file
59
modules/home/common.nix
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
options.dot = {
|
||||||
|
dotfilesPath = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "${config.home.homeDirectory}/dev/dot";
|
||||||
|
description = "Absolute path to the dotfiles repository on the local machine.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./secrets.nix
|
||||||
|
./sh.nix
|
||||||
|
./tmux.nix
|
||||||
|
./git.nix
|
||||||
|
./dev.nix
|
||||||
|
./nvim.nix
|
||||||
|
./task.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
config = {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
nerd-fonts.fira-code
|
||||||
|
nil # Nix LSP
|
||||||
|
|
||||||
|
# Language servers
|
||||||
|
yaml-language-server
|
||||||
|
marksman
|
||||||
|
pkgs.unstable.dockerfile-language-server # Use unstable for latest LSP features
|
||||||
|
|
||||||
|
# Secrets management
|
||||||
|
sops
|
||||||
|
age
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.ssh = {
|
||||||
|
enable = true;
|
||||||
|
enableDefaultConfig = false;
|
||||||
|
includes = [ "config.local" ];
|
||||||
|
matchBlocks = {
|
||||||
|
"*" = {
|
||||||
|
addKeysToAgent = "yes";
|
||||||
|
};
|
||||||
|
|
||||||
|
"git.pander.me" = {
|
||||||
|
hostname = "git.pander.me";
|
||||||
|
user = "git";
|
||||||
|
identityFile = "~/.ssh/private_git";
|
||||||
|
port = 2222;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
news.display = "silent";
|
||||||
|
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
52
modules/home/dev.nix
Normal file
52
modules/home/dev.nix
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.dot.llm;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.dot.llm = {
|
||||||
|
enable = lib.mkEnableOption "LLM tools";
|
||||||
|
claude-code.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable claude-code";
|
||||||
|
};
|
||||||
|
opencode.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable opencode";
|
||||||
|
};
|
||||||
|
gemini-cli.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable gemini-cli";
|
||||||
|
};
|
||||||
|
bubblewrap.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = pkgs.stdenv.isLinux;
|
||||||
|
description = "Enable bubblewrap (Linux only)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
programs.direnv = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
nix-direnv.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
visidata
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
(lib.mkIf cfg.enable {
|
||||||
|
home.packages =
|
||||||
|
(lib.optional cfg.claude-code.enable pkgs.unstable.claude-code) ++
|
||||||
|
(lib.optional cfg.opencode.enable pkgs.unstable.opencode) ++
|
||||||
|
(lib.optional cfg.gemini-cli.enable pkgs.unstable.gemini-cli) ++
|
||||||
|
(lib.optional (cfg.bubblewrap.enable && pkgs.stdenv.isLinux) pkgs.unstable.bubblewrap);
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.git = {
|
programs.git = {
|
||||||
@@ -59,6 +59,7 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Difftastic - modern diff tool
|
||||||
programs.difftastic = {
|
programs.difftastic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
git.enable = true;
|
git.enable = true;
|
||||||
100
modules/home/nvim.nix
Normal file
100
modules/home/nvim.nix
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.dot.nvim;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.dot.nvim = {
|
||||||
|
workMode = lib.mkEnableOption "work-specific neovim configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
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 ]))
|
||||||
|
];
|
||||||
|
|
||||||
|
extraLuaConfig = ''
|
||||||
|
_G.is_work = ${if cfg.workMode then "true" else "false"}
|
||||||
|
_G.is_home = ${if pkgs.stdenv.isDarwin then "true" else "false"}
|
||||||
|
|
||||||
|
require('base')
|
||||||
|
require('keymaps')
|
||||||
|
require('plugins')
|
||||||
|
require('filetype')
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Allow for editing the lua modules without a nix rebuild
|
||||||
|
xdg.configFile."nvim/lua".source = config.lib.file.mkOutOfStoreSymlink "${config.dot.dotfilesPath}/modules/nvim/lua";
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
nodejs-slim
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
20
modules/home/secrets.nix
Normal file
20
modules/home/secrets.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ inputs, config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
|
];
|
||||||
|
|
||||||
|
sops = {
|
||||||
|
defaultSopsFile = ../../secrets/secrets.yaml;
|
||||||
|
defaultSopsFormat = "yaml";
|
||||||
|
|
||||||
|
age = {
|
||||||
|
keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
SOPS_AGE_KEY_FILE = config.sops.age.keyFile;
|
||||||
|
};
|
||||||
|
}
|
||||||
109
modules/home/sh.nix
Normal file
109
modules/home/sh.nix
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.dot.sh;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.dot.sh = {
|
||||||
|
sourceProfile = lib.mkEnableOption "sourcing of $HOME/.profile in zsh profileExtra";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
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"
|
||||||
|
"ssh"
|
||||||
|
"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 = lib.mkIf cfg.sourceProfile ''
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{config, pkgs, lib, ...}:
|
{config, pkgs, lib, inputs, ...}:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.taskwarrior = {
|
programs.taskwarrior = {
|
||||||
@@ -62,7 +62,8 @@
|
|||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
taskwarrior-tui
|
taskwarrior-tui
|
||||||
timewarrior
|
unstable.timewarrior
|
||||||
|
inputs.tasksquire.packages.${pkgs.system}.default
|
||||||
];
|
];
|
||||||
|
|
||||||
home.shellAliases = lib.mkMerge [ {
|
home.shellAliases = lib.mkMerge [ {
|
||||||
83
modules/home/tmux.nix
Normal file
83
modules/home/tmux.nix
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.dot.tmux;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.dot.tmux = {
|
||||||
|
workMode = lib.mkEnableOption "work-specific tmux configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
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-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"
|
||||||
|
|
||||||
|
${lib.optionalString cfg.workMode ''
|
||||||
|
bind C-s display-popup -E "zsh ~/bin/tmuxp_selector.sh"
|
||||||
|
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,6 +1,10 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
./secrets.nix
|
||||||
|
];
|
||||||
|
|
||||||
time.timeZone = "Europe/Berlin";
|
time.timeZone = "Europe/Berlin";
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
@@ -17,6 +21,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
programs.ssh.startAgent = true;
|
||||||
|
programs.nix-ld.enable = true;
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
18
modules/nixos/secrets.nix
Normal file
18
modules/nixos/secrets.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{ inputs, config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.sops-nix.nixosModules.sops
|
||||||
|
];
|
||||||
|
|
||||||
|
sops = {
|
||||||
|
defaultSopsFile = ../../secrets/secrets.yaml;
|
||||||
|
defaultSopsFormat = "yaml";
|
||||||
|
|
||||||
|
age = {
|
||||||
|
sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||||
|
# keyFile = "/var/lib/sops-nix/key.txt";
|
||||||
|
# generateKey = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -133,7 +133,7 @@ vim.api.nvim_create_user_command('TrimWhiteSpace', function()
|
|||||||
vim.cmd('%s/\\s\\+$//e')
|
vim.cmd('%s/\\s\\+$//e')
|
||||||
end, {})
|
end, {})
|
||||||
|
|
||||||
local function ToggleDiagnostics()
|
function ToggleDiagnostics()
|
||||||
vim.diagnostic.enable(not vim.diagnostic.is_enabled())
|
vim.diagnostic.enable(not vim.diagnostic.is_enabled())
|
||||||
if vim.diagnostic.is_enabled() then
|
if vim.diagnostic.is_enabled() then
|
||||||
print("Diagnostics enabled")
|
print("Diagnostics enabled")
|
||||||
@@ -10,10 +10,6 @@ require('mini.move').setup()
|
|||||||
require('flash').setup()
|
require('flash').setup()
|
||||||
require('ts-comments').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
|
||||||
vim.g.tagbar_autofocus=1
|
vim.g.tagbar_autofocus=1
|
||||||
@@ -381,7 +377,7 @@ dap.configurations.zig = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if vim.fn.has("mac") then
|
if _G.is_home then
|
||||||
workspaces = {
|
workspaces = {
|
||||||
{
|
{
|
||||||
name = "privat",
|
name = "privat",
|
||||||
@@ -400,7 +396,7 @@ if vim.fn.has("mac") then
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
if is_wsl_env() then
|
if _G.is_work then
|
||||||
workspaces = {
|
workspaces = {
|
||||||
{
|
{
|
||||||
name = "work",
|
name = "work",
|
||||||
13
modules/overlays/unstable.nix
Normal file
13
modules/overlays/unstable.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Overlay to provide unstable packages under pkgs.unstable.* namespace
|
||||||
|
# This allows using stable packages by default while selectively using
|
||||||
|
# unstable versions for specific packages (e.g., LLM development tools)
|
||||||
|
#
|
||||||
|
# Usage: Pass nixpkgs input when applying overlay:
|
||||||
|
# overlays = [ (import ./modules/overlays/unstable.nix nixpkgs) ];
|
||||||
|
|
||||||
|
nixpkgs: final: prev: {
|
||||||
|
unstable = import nixpkgs {
|
||||||
|
inherit (prev) system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
107
newnix/flake.lock
generated
107
newnix/flake.lock
generated
@@ -1,107 +0,0 @@
|
|||||||
{
|
|
||||||
"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
|
|
||||||
}
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
{
|
|
||||||
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 ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{ 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";
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
{ 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;
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs.direnv = {
|
|
||||||
enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
visidata
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
{ 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" "@-"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
bubblewrap
|
|
||||||
claude-code
|
|
||||||
opencode
|
|
||||||
gemini-cli
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
{ 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
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
{ 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";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
{ 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,71 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./user/sh.nix
|
|
||||||
./user/tmux.nix
|
|
||||||
./user/git.nix
|
|
||||||
./user/dev.nix
|
|
||||||
./user/nvim.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
nil
|
|
||||||
# neovim
|
|
||||||
|
|
||||||
# (pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; })
|
|
||||||
pkgs.nerd-fonts.fira-code
|
|
||||||
|
|
||||||
pkgs.nix-ld
|
|
||||||
|
|
||||||
# (pkgs.writeShellScriptBin "my-hello" ''
|
|
||||||
# echo "Hello, ${config.home.username}!"
|
|
||||||
# '')
|
|
||||||
];
|
|
||||||
|
|
||||||
home.file = {
|
|
||||||
# ".screenrc".source = dotfiles/screenrc;
|
|
||||||
|
|
||||||
# ".gradle/gradle.properties".text = ''
|
|
||||||
# org.gradle.console=verbose
|
|
||||||
# org.gradle.daemon.idletimeout=3600000
|
|
||||||
# '';
|
|
||||||
};
|
|
||||||
|
|
||||||
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.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
|
|
||||||
# either
|
|
||||||
#
|
|
||||||
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
|
|
||||||
#
|
|
||||||
# or
|
|
||||||
#
|
|
||||||
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
|
|
||||||
#
|
|
||||||
# or
|
|
||||||
#
|
|
||||||
# /etc/profiles/per-user/moustachioed/etc/profile.d/hm-session-vars.sh
|
|
||||||
#
|
|
||||||
#home.sessionVariables = {
|
|
||||||
# EDITOR = "nvim";
|
|
||||||
#};
|
|
||||||
#home.shellAliases = {
|
|
||||||
# "ll" = "ls -la";
|
|
||||||
# "t" = "tmuxp";
|
|
||||||
# "tl" = "tmuxp load";
|
|
||||||
# };
|
|
||||||
|
|
||||||
news.display = "silent";
|
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
}
|
|
||||||
69
nix/flake.lock
generated
69
nix/flake.lock
generated
@@ -1,69 +0,0 @@
|
|||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"home-manager": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1770164260,
|
|
||||||
"narHash": "sha256-mQgOAYWlVJyuyXjZN6yxqXWyODvQI5P/UZUCU7IOuYo=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"rev": "4fda26500b4539e0a1e3afba9f0e1616bdad4f85",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1770115704,
|
|
||||||
"narHash": "sha256-KHFT9UWOF2yRPlAnSXQJh6uVcgNcWlFqqiAZ7OVlHNc=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "e6eae2ee2110f3d31110d5c222cd395303343b08",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"home-manager": "home-manager",
|
|
||||||
"nix-darwin": "nix-darwin",
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
{
|
|
||||||
description = "Home Manager configuration of moustachioed";
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
||||||
nix-darwin.url = "github:LnL7/nix-darwin";
|
|
||||||
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
home-manager = {
|
|
||||||
url = "github:nix-community/home-manager";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { self, nix-darwin, nixpkgs, home-manager, ... }:
|
|
||||||
let
|
|
||||||
#system = "x86_64-darwin";
|
|
||||||
system = "x86_64-linux";
|
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
|
|
||||||
configuration = { pkgs, ... }: {
|
|
||||||
environment.systemPackages =
|
|
||||||
[
|
|
||||||
pkgs.vim
|
|
||||||
];
|
|
||||||
|
|
||||||
# Auto upgrade nix package and the daemon service.
|
|
||||||
services.nix-daemon.enable = true;
|
|
||||||
# nix.package = pkgs.nix;
|
|
||||||
|
|
||||||
nix.settings.experimental-features = "nix-command flakes";
|
|
||||||
|
|
||||||
programs.zsh.enable = true; # default shell on catalina
|
|
||||||
|
|
||||||
# Set Git commit hash for darwin-version.
|
|
||||||
system.configurationRevision = self.rev or self.dirtyRev or null;
|
|
||||||
|
|
||||||
# Used for backwards compatibility, please read the changelog before changing.
|
|
||||||
# $ darwin-rebuild changelog
|
|
||||||
system.stateVersion = 4;
|
|
||||||
|
|
||||||
# The platform the configuration will be used on.
|
|
||||||
nixpkgs.hostPlatform = system;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
# Build darwin flake using:
|
|
||||||
# $ darwin-rebuild build --flake .#Martins-MacBook-Pro
|
|
||||||
darwinConfigurations."Martins-MacBook-Pro" = nix-darwin.lib.darwinSystem {
|
|
||||||
modules = [ configuration ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Expose the package set, including overlays, for convenience.
|
|
||||||
darwinPackages = self.darwinConfigurations."Martins-MacBook-Pro".pkgs;
|
|
||||||
|
|
||||||
homeConfigurations = {
|
|
||||||
"moustachioed" = home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
./user/profiles/moustachioedBook.nix
|
|
||||||
./common.nix
|
|
||||||
./user/task_home.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
"martin" = home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
./user/profiles/martin.nix
|
|
||||||
./common.nix
|
|
||||||
./user/task_home.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
"pan" = home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
./user/profiles/work.nix
|
|
||||||
./common.nix
|
|
||||||
./user/task.nix
|
|
||||||
{
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,206 +0,0 @@
|
|||||||
# 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! 🎉
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
# 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
|
|
||||||
@@ -1,282 +0,0 @@
|
|||||||
# 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.
|
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
# 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! 🚀
|
|
||||||
@@ -1,173 +0,0 @@
|
|||||||
# 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)?
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
# 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
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
# 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
86
nix/nixos/flake.lock
generated
@@ -1,86 +0,0 @@
|
|||||||
{
|
|
||||||
"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
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
{ 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";
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs.direnv = {
|
|
||||||
enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
visidata
|
|
||||||
bubblewrap
|
|
||||||
|
|
||||||
claude-code
|
|
||||||
opencode
|
|
||||||
gemini-cli
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
{ 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
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
{ 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";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
{ 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 +0,0 @@
|
|||||||
/nix/store/sdjnb1hp96jbv904y92vnil7cjnc8x78-nixos-system-nix-26.05.20260204.00c21e4
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs.direnv = {
|
|
||||||
enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
visidata
|
|
||||||
claude-code
|
|
||||||
opencode
|
|
||||||
gemini-cli
|
|
||||||
bubblewrap
|
|
||||||
# crush
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
{ 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" "@-"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
{ 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 ]))
|
|
||||||
];
|
|
||||||
|
|
||||||
# extraConfig = ''
|
|
||||||
# set t_vb=
|
|
||||||
# '';
|
|
||||||
|
|
||||||
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
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.username = "martin";
|
|
||||||
home.homeDirectory = "/Users/martin";
|
|
||||||
|
|
||||||
home.stateVersion = "24.05"; # Please read the comment before changing.
|
|
||||||
|
|
||||||
programs.git = {
|
|
||||||
userName = "Martin";
|
|
||||||
userEmail = "git@pander-on.de";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.username = "moustachioed";
|
|
||||||
home.homeDirectory = "/Users/moustachioed";
|
|
||||||
|
|
||||||
home.stateVersion = "23.11"; # Please read the comment before changing.
|
|
||||||
|
|
||||||
programs.git = {
|
|
||||||
userName = "Martin";
|
|
||||||
userEmail = "git@pander-on.de";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.username = "pan";
|
|
||||||
home.homeDirectory = "/home/pan";
|
|
||||||
|
|
||||||
home.stateVersion = "23.11"; # Please read the comment before changing.
|
|
||||||
|
|
||||||
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; [
|
|
||||||
yaml-language-server
|
|
||||||
marksman
|
|
||||||
dockerfile-language-server
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.zsh.profileExtra = ''
|
|
||||||
source $HOME/.profile
|
|
||||||
'';
|
|
||||||
|
|
||||||
}
|
|
||||||
119
nix/user/sh.nix
119
nix/user/sh.nix
@@ -1,119 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs.zsh = {
|
|
||||||
enable = true;
|
|
||||||
enableCompletion = true;
|
|
||||||
autosuggestion.enable = true;
|
|
||||||
syntaxHighlighting.enable = true;
|
|
||||||
|
|
||||||
history.size = 500000;
|
|
||||||
#history.path = "${config.xdg.dataHome}/zsh/history";
|
|
||||||
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
|
|
||||||
|
|
||||||
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;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
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
|
|
||||||
# (llm.withPlugins (ps: [
|
|
||||||
# ps.llm-gemini
|
|
||||||
# ps.llm-claude
|
|
||||||
# ]))
|
|
||||||
];
|
|
||||||
|
|
||||||
home.sessionVariables = lib.mkMerge [ {
|
|
||||||
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 .";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
{config, pkgs, lib, ...}:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs.taskwarrior = {
|
|
||||||
enable = true;
|
|
||||||
colorTheme = "light-256";
|
|
||||||
package = pkgs.taskwarrior3;
|
|
||||||
config = {
|
|
||||||
weekstart = "monday";
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
context.today.read = "-deferred and (prio:H or +next)";
|
|
||||||
context.today.write = "prio:H or +next";
|
|
||||||
context.deferred.read = "+deferred";
|
|
||||||
context.deferred.write = "+deferred";
|
|
||||||
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
|
|
||||||
];
|
|
||||||
|
|
||||||
home.shellAliases = lib.mkMerge [ {
|
|
||||||
t = "task";
|
|
||||||
tt = "taskwarrior-tui";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
{ 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"
|
|
||||||
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
|
|
||||||
#######################################
|
|
||||||
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 = lib.mkMerge [ {
|
|
||||||
"o" = "tmuxp";
|
|
||||||
"ol" = "tmuxp load";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
10
secrets/.sops.yaml
Normal file
10
secrets/.sops.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
keys:
|
||||||
|
- &macbook age1hmgy68ukugduef75ev72jnpu77ff3lajadpf7u0zv3ex4nt7f5qs5nxx2l
|
||||||
|
- &macnix age1yez9q5q94kt99d9q8eqgqrkz7djmk3kwsqdjp7ww7e0fquzjevpsjkk5x4
|
||||||
|
|
||||||
|
creation_rules:
|
||||||
|
- path_regex: secrets\.yaml$
|
||||||
|
key_groups:
|
||||||
|
- age:
|
||||||
|
- *macbook
|
||||||
|
- *macnix
|
||||||
25
secrets/secrets.yaml
Normal file
25
secrets/secrets.yaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
gemini_api_key: ENC[AES256_GCM,data:nN7Hng==,iv:uOL0UyHpiRpAXfkX8qyVAnJZFm4ljkgYiZycrdSoW9U=,tag:7A/rHJcEykcoyJLeTV/gaw==,type:str]
|
||||||
|
sops:
|
||||||
|
age:
|
||||||
|
- recipient: age1hmgy68ukugduef75ev72jnpu77ff3lajadpf7u0zv3ex4nt7f5qs5nxx2l
|
||||||
|
enc: |
|
||||||
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAxUEZwYkFDYVd4ek53QU13
|
||||||
|
YStKbEVOeTJaalVIWXh1SUlrSnUzanM0anpBCktBMytXQUNyOTZaZGc4NG1Ta1lX
|
||||||
|
Mi91UWxXZWZjRDZqNDJWQU1YODgzUkkKLS0tIFY4TjUyczQ0SGZMOUM0NkQvUC94
|
||||||
|
WDBpdDJMaWVvUGZUcXZLZE9oYjdKLzgK4B25MbF/3bUFJ5+zxUfpSNM79HT13nux
|
||||||
|
dvlcwkwYKIkS9YZpnyiYXZGupFhUcq1ipIvsbq/B3WR9IFn4xromPw==
|
||||||
|
-----END AGE ENCRYPTED FILE-----
|
||||||
|
- recipient: age1yez9q5q94kt99d9q8eqgqrkz7djmk3kwsqdjp7ww7e0fquzjevpsjkk5x4
|
||||||
|
enc: |
|
||||||
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBvK0lsajZ1b3dlMVA4Z2hm
|
||||||
|
ek9lZENNYnVnQXp2U0hGM2pDd0FSL2JVbVhVClZUTWhNcmJadSttU2UrRVhTWU1y
|
||||||
|
RVV6NlpndEsyYk9zSmRqLytOWUtCNWMKLS0tIGN1TDJPY2orMGJobFExUEhWYzdx
|
||||||
|
dDB3YWVlbUY4V25pa0IvTW1xNG1XcmMK+LLoW8f+M0eBIyxwI3tD637Fw/FuXmYx
|
||||||
|
RV/hAOaznmfq3filh9KAEA+A/9mDI2lUeF/ye/g27tEEVtNRF9H+Dg==
|
||||||
|
-----END AGE ENCRYPTED FILE-----
|
||||||
|
lastmodified: "2026-02-07T15:11:34Z"
|
||||||
|
mac: ENC[AES256_GCM,data:Pgi9tYWnrMrlM9NjqDy0+BrH51/0T4c7M6dornLCumnRtR2Y3MZYGyA2E97kbwuqoPJCOWkzhJt7smwCRI+H0rXveO+ps+v5iUxzP+7MQmepn5wjS32HoL5c2Oer4CR7PkKY7YvL7z5IT6QcIgRXMODhsVbWgB8CjPrn/GYqb5Y=,iv:A2AyCNHfQEdx/wvUJQGc9ndL2/OYGGxBMidYOTHXO7Q=,tag:9uzJcu3bogQgVj0bDOPCwg==,type:str]
|
||||||
|
unencrypted_suffix: _unencrypted
|
||||||
|
version: 3.11.0
|
||||||
Reference in New Issue
Block a user