Compare commits
10 commits
a465daa9c7
...
5e1a7a173b
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e1a7a173b | |||
| 1b1069996f | |||
| e6ed1d8c3b | |||
| dee3e58978 | |||
| a269b2856f | |||
| 3e57916a3f | |||
| 2b5dce5727 | |||
| a689d23a8e | |||
| ab376d21aa | |||
| f4a516aa5c |
8 changed files with 61 additions and 31 deletions
12
AGENTS.md
12
AGENTS.md
|
|
@ -7,7 +7,7 @@
|
||||||
- **declarative nix config** для нескольких хостов через nix-darwin + home-manager
|
- **declarative nix config** для нескольких хостов через nix-darwin + home-manager
|
||||||
- активный: **poppy** (MacBook Air M1)
|
- активный: **poppy** (MacBook Air M1)
|
||||||
- planned: **muscari** (NixOS server), **rosemary** (backup VM)
|
- planned: **muscari** (NixOS server), **rosemary** (backup VM)
|
||||||
- user: `michaotic` (planned: `mikl`)
|
- user: `mikl`
|
||||||
|
|
||||||
## structure
|
## structure
|
||||||
|
|
||||||
|
|
@ -28,18 +28,14 @@
|
||||||
│
|
│
|
||||||
├── home/ # home-manager modules
|
├── home/ # home-manager modules
|
||||||
│ ├── default.nix # imports, sessionVariables
|
│ ├── default.nix # imports, sessionVariables
|
||||||
│ ├── cli.nix # CLI tools (universal)
|
│ ├── cli.nix # CLI tools (universal) + zoxide, bat, eza, fzf
|
||||||
│ ├── git.nix # git config
|
│ ├── git.nix # git config
|
||||||
│ ├── ssh.nix # SSH matchBlocks
|
│ ├── ssh.nix # SSH matchBlocks
|
||||||
│ ├── zsh.nix # shell + aliases
|
│ ├── zsh.nix # shell + aliases
|
||||||
│ ├── kitty.nix # terminal
|
│ ├── kitty.nix # terminal
|
||||||
│ ├── duti.nix # default apps
|
│ ├── duti.nix # default apps (macOS only)
|
||||||
│ ├── pass.nix # pass + gpg-agent (только для GPG)
|
│ ├── pass.nix # pass + gpg-agent (только для GPG)
|
||||||
│ ├── syncthing.nix # p2p sync
|
│ └── syncthing.nix # p2p sync
|
||||||
│ ├── zoxide.nix
|
|
||||||
│ ├── bat.nix
|
|
||||||
│ ├── eza.nix
|
|
||||||
│ └── fzf.nix
|
|
||||||
│
|
│
|
||||||
└── docs/ # документация
|
└── docs/ # документация
|
||||||
├── structure.md # high-level overview
|
├── structure.md # high-level overview
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ cd ~/repos/nix-config
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# если есть приватная репа с зашифрованным gpg ключом
|
# если есть приватная репа с зашифрованным gpg ключом
|
||||||
git clone https://git.iscg.dev/mikl/gpg-secrets.git /tmp/gpg-setup
|
git clone https://git.iscg.dev/mikl/gpg.git ~/tmp/gpg
|
||||||
gpg --import /tmp/gpg-setup/gpg-private.asc
|
gpg --import /tmp/gpg/private.asc
|
||||||
rm -rf /tmp/gpg-setup
|
rm -rf ~/tmp/gpg
|
||||||
|
|
||||||
# проверить
|
# проверить
|
||||||
gpg --list-secret-keys mikl@iscg.dev
|
gpg --list-secret-keys mikl@iscg.dev
|
||||||
|
|
@ -64,16 +64,17 @@ sudo nixos-rebuild switch --flake .#muscari
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# если есть существующий password store
|
# если есть существующий password store
|
||||||
git clone https://git.iscg.dev/mikl/password-store.git ~/.password-store
|
git clone https://git.iscg.dev/mikl/pass.git ~/.password-store
|
||||||
cd ~/.password-store && git remote remove origin && git remote add origin https://git.iscg.dev/mikl/password-store.git
|
cd ~/.password-store && git remote remove origin && git remote add origin https://git.iscg.dev/mikl/password-store.git
|
||||||
|
|
||||||
# если создаёшь с нуля
|
# если создаёшь с нуля
|
||||||
pass init <gpg-key-id> # id от gpg --list-secret-keys
|
pass init <gpg-key-id> # id от gpg --list-secret-keys
|
||||||
pass git init
|
pass git init
|
||||||
pass git remote add origin https://git.iscg.dev/mikl/password-store.git
|
pass git remote add origin https://git.iscg.dev/mikl/pass.git
|
||||||
```
|
```
|
||||||
|
|
||||||
после этого работают алиасы:
|
после этого работают алиасы:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pass-sync # = pass git push
|
pass-sync # = pass git push
|
||||||
pass-pull # = pass git pull
|
pass-pull # = pass git pull
|
||||||
|
|
@ -89,6 +90,7 @@ pass-status # = pass git status
|
||||||
3. **Change All...** → подтвердить
|
3. **Change All...** → подтвердить
|
||||||
|
|
||||||
для каких файлов:
|
для каких файлов:
|
||||||
|
|
||||||
- `.url`, `.xhtml` → Chrome
|
- `.url`, `.xhtml` → Chrome
|
||||||
- `.sh` → kitty
|
- `.sh` → kitty
|
||||||
- `.pdf` → Skim
|
- `.pdf` → Skim
|
||||||
|
|
|
||||||
15
home/cli.nix
15
home/cli.nix
|
|
@ -15,7 +15,6 @@
|
||||||
htop
|
htop
|
||||||
tldr
|
tldr
|
||||||
fastfetch
|
fastfetch
|
||||||
tree
|
|
||||||
|
|
||||||
# Editor
|
# Editor
|
||||||
micro
|
micro
|
||||||
|
|
@ -62,6 +61,20 @@
|
||||||
options = [ "--cmd cd" ];
|
options = [ "--cmd cd" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Atuin - encrypted shell history with sync
|
||||||
|
programs.atuin = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
settings = {
|
||||||
|
auto_sync = true;
|
||||||
|
sync_frequency = "5m";
|
||||||
|
search_mode = "fuzzy";
|
||||||
|
style = "compact";
|
||||||
|
show_preview = true;
|
||||||
|
exit_mode = "return-query";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Bat - cat with syntax highlighting
|
# Bat - cat with syntax highlighting
|
||||||
programs.bat = {
|
programs.bat = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,8 @@
|
||||||
|
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
SEARXNG_URL = "https://search.iscg.dev";
|
SEARXNG_URL = "https://search.iscg.dev";
|
||||||
PATH = "/etc/profiles/per-user/mikl/bin:$HOME/.nix-profile/bin:$HOME/bin:$HOME/.local/bin:$HOME/.npm-global/bin:/Users/mikl/.opencode/bin:/Users/mikl/.local/share/pi-node/node-v22.23.1-darwin-arm64/bin";
|
PATH = "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin:/run/current-system/sw/bin:/etc/profiles/per-user/mikl/bin:$HOME/.nix-profile/bin:$HOME/bin:$HOME/.local/bin:$HOME/.npm-global/bin:/Users/mikl/.opencode/bin:/Users/mikl/.local/share/pi-node/node-v22.23.1-darwin-arm64/bin";
|
||||||
# OPENROUTER_API_KEY = ""; # TODO: move to sops-nix secrets
|
|
||||||
SOPS_AGE_KEY_FILE = "$HOME/.config/sops/age/keys.txt";
|
|
||||||
EDITOR = "micro";
|
EDITOR = "micro";
|
||||||
VISUAL = "micro";
|
VISUAL = "micro";
|
||||||
KUBECONFIG = "$HOME/.kube/config-jul11";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,12 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
# Copy kitty.app to ~/Applications/ for Spotlight indexing
|
||||||
|
# (home-manager creates symlink, Spotlight doesn't index symlinks)
|
||||||
|
home.file."Applications/kitty.app" = {
|
||||||
|
source = "${pkgs.kitty}/Applications/kitty.app";
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
|
||||||
programs.kitty = {
|
programs.kitty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
|
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
|
||||||
settings = {
|
settings = {
|
||||||
PASSWORD_STORE_DIR = "$HOME/.password-store";
|
PASSWORD_STORE_DIR = "$HOME/.password-store";
|
||||||
PASSWORD_STORE_GIT = "ssh://git@git.iscg.dev:2222/mikl/password-store.git";
|
PASSWORD_STORE_GIT = "ssh://git@git.iscg.dev:2222/mikl/pass.git";
|
||||||
PASSWORD_STORE_X_SELECTION_TIMEOUT = "5";
|
PASSWORD_STORE_X_SELECTION_TIMEOUT = "5";
|
||||||
PASSWORD_STORE_CLIP_TIME = "45";
|
PASSWORD_STORE_CLIP_TIME = "45";
|
||||||
PASSWORD_STORE_GENERATED_LENGTH = "25";
|
PASSWORD_STORE_GENERATED_LENGTH = "25";
|
||||||
|
|
|
||||||
22
home/ssh.nix
22
home/ssh.nix
|
|
@ -1,26 +1,26 @@
|
||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
# SSH client configuration with host-specific keys
|
# SSH client configuration
|
||||||
|
# TEMP: using single key 'poppy' for all hosts - create host-specific keys later
|
||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
matchBlocks = {
|
matchBlocks = {
|
||||||
# Forgejo (personal) — port 2222
|
# All git forges use the same key for now
|
||||||
|
"git.*" = {
|
||||||
|
identityFile = "~/.ssh/poppy";
|
||||||
|
identitiesOnly = true;
|
||||||
|
addKeysToAgent = "yes";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Specific hosts (port override for forgejo)
|
||||||
"git.iscg.dev" = {
|
"git.iscg.dev" = {
|
||||||
identityFile = "~/.ssh/id_ed25519_forgejo";
|
identityFile = "~/.ssh/poppy";
|
||||||
port = 2222;
|
port = 2222;
|
||||||
identitiesOnly = true;
|
identitiesOnly = true;
|
||||||
addKeysToAgent = "yes";
|
addKeysToAgent = "yes";
|
||||||
};
|
};
|
||||||
|
|
||||||
# GitHub
|
|
||||||
"github.com" = {
|
|
||||||
identityFile = "~/.ssh/id_ed25519";
|
|
||||||
identitiesOnly = true;
|
|
||||||
addKeysToAgent = "yes";
|
|
||||||
};
|
|
||||||
|
|
||||||
# git.sol.moe
|
|
||||||
"git.sol.moe" = {
|
"git.sol.moe" = {
|
||||||
identityFile = "~/.ssh/poppy";
|
identityFile = "~/.ssh/poppy";
|
||||||
user = "mikl";
|
user = "mikl";
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,12 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
CustomUserPreferences = {
|
CustomUserPreferences = {
|
||||||
|
# Disable system sound effects (screenshots, etc.)
|
||||||
|
"com.apple.systemsound" = {
|
||||||
|
"com.apple.sound.beep.feedback" = 0; # No feedback sound when changing volume
|
||||||
|
"com.apple.sound.uiaudio.enabled" = 0; # Disable UI sounds (screenshots, etc.)
|
||||||
|
};
|
||||||
|
|
||||||
"com.apple.HIToolbox" = {
|
"com.apple.HIToolbox" = {
|
||||||
AppleEnabledInputSources = [
|
AppleEnabledInputSources = [
|
||||||
{
|
{
|
||||||
|
|
@ -132,13 +138,22 @@
|
||||||
"/System/Applications/Calendar.app"
|
"/System/Applications/Calendar.app"
|
||||||
"/Applications/Obsidian.app"
|
"/Applications/Obsidian.app"
|
||||||
"/Applications/VSCodium.app"
|
"/Applications/VSCodium.app"
|
||||||
"/Users/mikl/Applications/Home Manager Apps/kitty.app"
|
"/Users/mikl/Applications/kitty.app"
|
||||||
|
"/System/Applications/Utilities/Activity Monitor.app"
|
||||||
"/System/Applications/Books.app"
|
"/System/Applications/Books.app"
|
||||||
"/System/Applications/QuickTime Player.app"
|
"/System/Applications/QuickTime Player.app"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Install Rosetta 2 for Intel apps on Apple Silicon
|
||||||
|
system.activationScripts.rosetta.text = ''
|
||||||
|
if ! /usr/bin/pgrep -q oahd 2>/dev/null; then
|
||||||
|
echo "Installing Rosetta 2..."
|
||||||
|
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
system.activationScripts.postActivation.text = ''
|
system.activationScripts.postActivation.text = ''
|
||||||
echo "Restarting Dock..."
|
echo "Restarting Dock..."
|
||||||
sudo -u mikl /usr/bin/killall Dock
|
sudo -u mikl /usr/bin/killall Dock
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue