From 55a2181d58ffc3d1b5d33c76c2ad2e031631427b Mon Sep 17 00:00:00 2001 From: mikl Date: Wed, 1 Jul 2026 18:53:33 +0300 Subject: [PATCH] docs: add todos for git remotes and pass-store sync --- docs/cheatsheet.md | 18 +++++++-- garden.md | 82 ---------------------------------------- home/default.nix | 1 - home/duti.nix | 19 ++++++++++ home/pass-store.nix | 38 ------------------- home/pass.nix | 43 +++++++++++++++++++++ hosts/poppy/homebrew.nix | 33 ++++++++++++++++ 7 files changed, 109 insertions(+), 125 deletions(-) delete mode 100644 home/pass-store.nix diff --git a/docs/cheatsheet.md b/docs/cheatsheet.md index 3f2765c..3cd336d 100644 --- a/docs/cheatsheet.md +++ b/docs/cheatsheet.md @@ -77,14 +77,24 @@ httrack "https://example.com" -O ./out "+*.example.com/*" ## default apps (duti) настраиваются через `~/.config/duti/config` (управляется в `home/duti.nix`): -- `com.google.Chrome` — html, url +- `com.google.Chrome` — html - `MarkEdit` — markdown -- `kitty` — shell scripts -- `com.apple.Preview` — pdf -- `com.apple.Mail` — mail +- `com.apple.Mail` — email проверить текущие defaults: ```bash duti -x html 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...** → подтвердить diff --git a/garden.md b/garden.md index fa05140..e69de29 100644 --- a/garden.md +++ b/garden.md @@ -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//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` явно diff --git a/home/default.nix b/home/default.nix index 3a42ef9..33915ee 100644 --- a/home/default.nix +++ b/home/default.nix @@ -7,7 +7,6 @@ ./zsh.nix ./duti.nix ./pass.nix - ./pass-store.nix ]; home.stateVersion = "24.11"; diff --git a/home/duti.nix b/home/duti.nix index e69de29..54568fe 100644 --- a/home/duti.nix +++ b/home/duti.nix @@ -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 +} diff --git a/home/pass-store.nix b/home/pass-store.nix deleted file mode 100644 index d28f660..0000000 --- a/home/pass-store.nix +++ /dev/null @@ -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 - ''; - }; -} diff --git a/home/pass.nix b/home/pass.nix index b74fd36..7097f58 100644 --- a/home/pass.nix +++ b/home/pass.nix @@ -19,4 +19,47 @@ defaultCacheTtl = 3600; 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} + ''; + }; } diff --git a/hosts/poppy/homebrew.nix b/hosts/poppy/homebrew.nix index e69de29..74b7b94 100644 --- a/hosts/poppy/homebrew.nix +++ b/hosts/poppy/homebrew.nix @@ -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" + ]; +}