docs: add todos for git remotes and pass-store sync

This commit is contained in:
mikl 2026-07-01 18:53:33 +03:00
parent df2d756a08
commit 55a2181d58
7 changed files with 109 additions and 125 deletions

View file

@ -77,14 +77,24 @@ httrack "https://example.com" -O ./out "+*.example.com/*"
## default apps (duti) ## default apps (duti)
настраиваются через `~/.config/duti/config` (управляется в `home/duti.nix`): настраиваются через `~/.config/duti/config` (управляется в `home/duti.nix`):
- `com.google.Chrome` — html, url - `com.google.Chrome` — html
- `MarkEdit` — markdown - `MarkEdit` — markdown
- `kitty` — shell scripts - `com.apple.Mail` — email
- `com.apple.Preview` — pdf
- `com.apple.Mail` — mail
проверить текущие defaults: проверить текущие defaults:
```bash ```bash
duti -x html duti -x html
duti -x md duti -x md
duti -x eml
``` ```
⚠️ **на macOS Sonoma+** Apple блокирует изменение через CLI для системных UTI:
- `public.url`, `public.xhtml` → Safari
- `public.shell-script` → Terminal/VSCodium
- `com.adobe.pdf` → Preview
- `public.text`, `public.plain-text` → TextEdit
для этих нужно вручную через Finder:
1. правый клик на файл → **Get Info**
2. **Open with:** → выбрать нужное приложение
3. **Change All...** → подтвердить

View file

@ -1,82 +0,0 @@
# garden
Hosts in this repo are named after plants and flowers.
## hosts
### poppy *(active)*
- **role:** MacBook Air M1, personal/work machine
- **system:** nix-darwin, aarch64-darwin
- **location:** daily driver
### muscari *(planned migration)*
- **role:** linux server, k3s cluster
- **system:** NixOS, x86_64-linux
- **location:** iscg infra
### rosemary *(planned)*
- **role:** backup VM
- **system:** NixOS, x86_64-linux
## structure
- `flake.nix` — entry point, dispatches `mkNixos` and `mkDarwin` per host
- `hosts/<name>/default.nix` — per-host config
- `hosts/common/default.nix` — shared NixOS config
- `hosts/common-darwin/default.nix` — shared darwin config
- `home/default.nix` — shared home-manager config for user `michaotic` (plan to migrate to `mikl` later)
- `secrets/` — sops-encrypted secrets per host
## documentation
notes are split by topic under `docs/`:
- `docs/structure.md` — high-level overview, where things go
- `docs/poppy.md` — MacBook specific (homebrew, system defaults)
- `docs/muscari.md` — server + k3s specifics
- `docs/shell.md` — zsh, pure prompt, plugins
- `docs/terminal.md` — kitty + catppuccin theme
- `docs/cheatsheet.md` — quick commands reference
when adding a new host: copy `docs/structure.md` template, document hostname, role, packages unique to it.
## migrations
- `nix-config-legacy/` — previous muscari-only config (preserved for reference)
## future plans
### username migration
currently using `michaotic` as username (historical). plan to migrate to `mikl` across all hosts for consistency.
**why not now:**
- macOS: changing username requires careful handling of home folder, keychain, permissions
- linux: easier, but better to do in one coordinated change
**when:** after setting up proper backups and testing migration procedure
### rosemary setup
currently `flake.nix` has `rosemary` commented out. need to:
- add disk config (likely similar to muscari)
- add users.users.michaotic.openssh.authorizedKeys
- test `nix flake check`
### documentation improvements
- [ ] create `docs/bootstrap.md` — manual setup guide for fresh device without nix (emergency fallback)
- list all CLI tools and how to install via brew/pnpm
- list all system defaults that need manual configuration
- explain which tools are nix-managed vs brew-managed
- [ ] create `docs/adding-host.md` — checklist for adding a new host
- [ ] create `docs/secrets.md` — sops-nix setup when we get there
- [ ] add migration notes to `docs/structure.md` as we learn patterns
- [ ] screenshots/notes for things that aren't obvious (e.g. dock layout)
### tech debt
- [ ] **git config** — разобраться с конфликтом `~/.gitconfig` (локальный) vs `~/.config/git/config` (home-manager)
- перенести osxkeychain credential helper, lfs в home-manager
- унифицировать user.name/email (michaotic vs mikl)
- добавить `core.pager = delta` явно

View file

@ -7,7 +7,6 @@
./zsh.nix ./zsh.nix
./duti.nix ./duti.nix
./pass.nix ./pass.nix
./pass-store.nix
]; ];
home.stateVersion = "24.11"; home.stateVersion = "24.11";

View file

@ -0,0 +1,19 @@
{ pkgs, ... }: {
home.packages = [ pkgs.duti ];
xdg.configFile."duti/config".text = ''
# browser (html работает, url/xhtml - Apple блокирует)
com.google.Chrome public.html all
# markdown viewer
MarkEdit net.daringfireball.markdown all
MarkEdit public.markdown all
# mail
com.apple.mail public.email-message all
# для .url, .pdf, .sh, .txt - настраивать вручную через Finder
# (Apple блокирует CLI настройку системных UTI на Sonoma+)
'';
# defaults applied via system.activationScripts.defaultApps in hosts/poppy/default.nix
}

View file

@ -1,38 +0,0 @@
{ config, pkgs, ... }:
{
# Setup git remotes for pass store
# This file manages the git remote configuration for ~/.password-store
# (pass itself is configured in home/pass.nix)
home.activation.passStoreRemotes = {
data = ''
set -e
if [ ! -d "$HOME/.password-store" ]; then
mkdir -p "$HOME/.password-store"
fi
cd "$HOME/.password-store"
# Init git if needed
if [ ! -d ".git" ]; then
${pkgs.git}/bin/git init -q
fi
# Add origin (forgejo) if not present
if ! ${pkgs.git}/bin/git remote get-url origin >/dev/null 2>&1; then
${pkgs.git}/bin/git remote add origin "ssh://git@git.iscg.dev:2222/mikl/password-store.git"
fi
# Add github remote if not present
if ! ${pkgs.git}/bin/git remote get-url github >/dev/null 2>&1; then
${pkgs.git}/bin/git remote add github "git@github.com:isogonalconjugate/password-store.git"
fi
# Add git.sol.moe remote if not present
if ! ${pkgs.git}/bin/git remote get-url "git.sol.moe" >/dev/null 2>&1; then
${pkgs.git}/bin/git remote add "git.sol.moe" "git@git.sol.moe:mikl/password-store.git"
fi
'';
};
}

View file

@ -19,4 +19,47 @@
defaultCacheTtl = 3600; defaultCacheTtl = 3600;
enableSshSupport = true; enableSshSupport = true;
}; };
# Activation: setup pass git origins (forgejo + github + sol.moe)
# Uses pkgs.writeShellScript to avoid home.activation.data string issues
home.activation.passOrigins = {
data = let
setupScript = pkgs.writeShellScript "pass-origins-setup" ''
set -e
# Initialize pass if not yet
if [ ! -d "$HOME/.password-store" ]; then
echo "Initializing pass store..."
mkdir -p "$HOME/.password-store"
fi
# Initialize git if not yet
if [ ! -d "$HOME/.password-store/.git" ]; then
cd "$HOME/.password-store"
${pkgs.git}/bin/git init -q
fi
cd "$HOME/.password-store"
# Add origin (forgejo) if not present
if ! ${pkgs.git}/bin/git remote get-url origin >/dev/null 2>&1; then
${pkgs.git}/bin/git remote add origin "ssh://git@git.iscg.dev:2222/mikl/password-store.git"
fi
# Add github remote if not present
if ! ${pkgs.git}/bin/git remote get-url github >/dev/null 2>&1; then
${pkgs.git}/bin/git remote add github "git@github.com:isogonalconjugate/password-store.git"
fi
# Add git.sol.moe remote if not present
if ! ${pkgs.git}/bin/git remote get-url git.sol.moe >/dev/null 2>&1; then
${pkgs.git}/bin/git remote add "git.sol.moe" "git@git.sol.moe:mikl/password-store.git"
fi
cd - >/dev/null
'';
in builtins.toFile "pass-origins.sh" ''
${setupScript}
'';
};
} }

View file

@ -0,0 +1,33 @@
{
homebrew.enable = true;
homebrew.onActivation.cleanup = "zap";
homebrew.taps = [];
homebrew.brews = [
"kew"
];
homebrew.casks = [
"google-chrome"
"google-drive"
"marta"
"vscodium"
"github"
"docker-desktop"
"ollama-app"
"microsoft-word"
"microsoft-excel"
"microsoft-powerpoint"
"obsidian"
"anki"
"calibre"
"telegram"
"maccy"
"mos"
"caffeine"
"lunacy"
"skim"
"markedit"
];
}