refactor: use michaotic username throughout, add cli/kitty/zsh configs and docs

This commit is contained in:
mikl 2026-06-28 23:54:14 +03:00
commit 5c14cf0539
17 changed files with 509 additions and 36 deletions

57
docs/cheatsheet.md Normal file
View file

@ -0,0 +1,57 @@
# cheatsheet
quick commands for daily use.
## rebuild
```bash
# poppy (macbook)
darwin-rebuild switch --flake .#poppy
# muscari (server)
sudo nixos-rebuild switch --flake .#muscari
```
## update
```bash
# update flakes then rebuild
nix flake update && darwin-rebuild switch --flake .#poppy
```
## check
```bash
# validate before applying
nix flake check
# dry run (see what would change)
darwin-rebuild switch --flake .#poppy --dry-run
```
## cleanup
```bash
# remove old generations
nix-collect-garbage -d
# or with sudo on nixos
sudo nix-collect-garbage -d
```
## shell
```bash
ll # detailed list with icons
cd <dir> # actually zoxide - remembers frequent paths
ff # fastfetch system info
```
## navigation
```bash
cd <partial> # zoxide - jump to frequent dir
cd .. # parent directory
ctrl+r # fzf history search
ctrl+t # fzf file finder
```

39
docs/muscari.md Normal file
View file

@ -0,0 +1,39 @@
# muscari
NixOS server on Yandex Cloud. k3s single-node cluster.
## specs
- VM: 2 vCPU / 8 GB RAM / 64 GB SSD
- IP: 158.160.166.30
- Network: Legacy BIOS (no EFI)
## quick rebuild
```bash
sudo nixos-rebuild switch --flake .#muscari
```
## imports
- `disk-config.nix` - disko partitioning
- `k3s.nix` - kubernetes cluster setup
- `hosts/common/` - shared nixos settings
## networking
open ports:
- 22 - ssh
- 80 - http (traefik ingress)
- 443 - https (traefik ingress)
6443 is closed - kubectl via ssh tunnel only.
## ssh keys
fetched from `https://git.iscg.dev/mikl.keys` with sha256 pinning.
## TODO
- [ ] k8s aliases (k, kx, kl, kd, etc)
- [ ] add nix-specific aliases (switch, update, cleanup with sudo)

34
docs/poppy.md Normal file
View file

@ -0,0 +1,34 @@
# poppy
MacBook Air M1 - daily driver.
## quick rebuild
```bash
darwin-rebuild switch --flake .#poppy
```
## what's specific here
### darwin system
- `nixpkgs.config.allowUnfree = true` - needed for some macos tools
- `services.nix-daemon.enable = true` - multi-user install
- home path: `/Users/mikl` (not `/home/mikl`)
### home-manager imports
- `home/kitty.nix` - terminal with catppuccin theme
### aliases
| alias | command |
|-------|---------|
| `switch` | `darwin-rebuild switch --flake .#poppy` |
| `update` | `nix flake update && darwin-rebuild switch --flake .#poppy` |
| `cleanup` | `nix-collect-garbage -d` |
## TODO
- [ ] telegram mcp aliases (tg-login, tg-reset)
- [ ] apple music tools (gamdl)

41
docs/shell.md Normal file
View file

@ -0,0 +1,41 @@
# shell
zsh configuration across all hosts.
## prompt
**pure** - minimal, fast, shows git status.
- green `>` on success
- red `>` on error
- right prompt: current time in gray
## plugins
| plugin | source | purpose |
|--------|--------|---------|
| pure | github (v1.23.0) | prompt theme |
| zsh-syntax-highlighting | nixpkgs | command coloring |
| zsh-autosuggestions | nixpkgs | gray command hints |
## history
- size: 10000
- shared between sessions
- ignores duplicates
- stored in `~/.local/share/zsh/history` (xdg)
## universal aliases
| alias | what |
|-------|------|
| `ll` | `eza -l --icons --git` |
| `la` | `eza -la --icons --git` |
| `ff` | `fastfetch` |
## startup
fastfetch runs automatically when opening new shell.
## host-specific
see `docs/poppy.md` and `docs/muscari.md` for per-host aliases (nix rebuild commands differ).

63
docs/structure.md Normal file
View file

@ -0,0 +1,63 @@
# structure
how the config is organized.
## top-level
```
nix-config/
├── flake.nix # entry point - dispatches to hosts
├── home/ # home-manager (user space)
├── hosts/ # system-level configs
├── secrets/ # sops-nix encrypted files
└── docs/ # this folder
```
## flake.nix flow
```
flake.nix
├── nixosConfigurations
│ ├── muscari → hosts/muscari/ + home/
│ └── rosemary → hosts/rosemary/ + home/
└── darwinConfigurations
└── poppy → hosts/poppy/ + home/
```
## home/ vs hosts/
| what | where | why |
|------|-------|-----|
| shell config | `home/` | same on all machines |
| terminal emulator | `home/` | gui apps belong here |
| system packages | `hosts/<name>/` | os-specific |
| networking | `hosts/<name>/` | per-host |
| hostname | `hosts/<name>/` | obviously |
## adding things
**new package for all hosts:**
→ add to `home/cli.nix` in `home.packages`
**new package for one host:**
→ add to `hosts/<name>/default.nix` in `environment.systemPackages`
**new alias for all hosts:**
→ add to `home/zsh.nix` in `programs.zsh.shellAliases`
**new alias for one host:**
→ add to `hosts/<name>/default.nix` in `home-manager.users.mikl.programs.zsh.shellAliases`
## host-specific imports
poppy imports `home/kitty.nix` because it has a screen. muscari doesn't.
```nix
# hosts/poppy/default.nix
home-manager.users.mikl = {
imports = [ ../../home/kitty.nix ];
programs.zsh.shellAliases = {
switch = "darwin-rebuild switch --flake .#poppy";
};
};
```

36
docs/terminal.md Normal file
View file

@ -0,0 +1,36 @@
# terminal
kitty configuration for gui hosts.
## where
`home/kitty.nix` - imported only by poppy (macbook).
## theme
**Catppuccin-Mocha** - dark, soft colors.
## font
JetBrainsMono Nerd Font, size 12.
## features
- **tabs**: powerline style, at bottom, slanted separators
- **transparency**: background blur 16
- **cursor**: beam shape
- **scrollback**: 10000 lines
- **cyrillic shortcuts**: cmd+м = paste, cmd+с = copy
## cyrillic config
loads `~/.config/kitty/cyrillic-shortcuts.conf` for additional layout fixes.
## applying changes
kitty reloads config automatically. if not:
```bash
killall kitty
# or ctrl+shift+f5 inside kitty
```