From 0e56d31d680473ae0bc7f0b8c42629d7f2062bb9 Mon Sep 17 00:00:00 2001 From: mikl Date: Sat, 26 Sep 2026 01:57:33 +0300 Subject: [PATCH] poppy: gcalcli; kitty opacity 0.84; gpg-agent ttl 600s; pay.nix darwin (skip autoPatchelfHook); syncthing launchd via nix-darwin; mihomo --- home/cli.nix | 1 + home/kitty.nix | 2 +- home/pass.nix | 3 ++- home/pay.nix | 6 ++++-- home/syncthing.nix | 19 +++---------------- hosts/poppy/apps.nix | 5 +---- hosts/poppy/default.nix | 16 ++++++++++++++++ 7 files changed, 28 insertions(+), 24 deletions(-) diff --git a/home/cli.nix b/home/cli.nix index b41b5c0..2092d24 100644 --- a/home/cli.nix +++ b/home/cli.nix @@ -40,6 +40,7 @@ yt-dlp # скачивание с YouTube и 1000+ сайтов (эталонный CLI) transmission_4 # BitTorrent: transmission-daemon + -remote + -create/show/edit CLI tools himalaya # IMAP/SMTP/JMAP почтовый CLI (JSON-вывод для агента) + gcalcli # Google Calendar CLI (OAuth, для агента) matrix-commander-rs # Matrix CLI клиент (E2E, JSON-вывод, для агента) # x402 / MPP agentic payments CLI (Solana Foundation) diff --git a/home/kitty.nix b/home/kitty.nix index 84febce..cf232d8 100644 --- a/home/kitty.nix +++ b/home/kitty.nix @@ -18,7 +18,7 @@ themeFile = "mellow"; settings = { - background_opacity = "0.96"; + background_opacity = "0.84"; dynamic_background_opacity = "yes"; background_blur = 16; cursor_shape = "beam"; diff --git a/home/pass.nix b/home/pass.nix index b789b20..859580b 100644 --- a/home/pass.nix +++ b/home/pass.nix @@ -16,6 +16,7 @@ # GPG agent settings (only for GPG/pass, NOT for SSH) services.gpg-agent = { enable = true; - defaultCacheTtl = 3600; + defaultCacheTtl = 600; + maxCacheTtl = 600; }; } diff --git a/home/pay.nix b/home/pay.nix index 6010701..a157bba 100644 --- a/home/pay.nix +++ b/home/pay.nix @@ -51,8 +51,10 @@ stdenv.mkDerivation { sourceRoot = "."; # tarball contains a single prebuilt `pay` binary at its root. - nativeBuildInputs = [ autoPatchelfHook ]; - buildInputs = [ openssl stdenv.cc.cc.lib ]; + # autoPatchelfHook is ELF-only and crashes on darwin Mach-O binaries; + # macOS prebuilts are self-contained, so patching is linux-only. + nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ]; + buildInputs = lib.optionals stdenv.isLinux [ openssl stdenv.cc.cc.lib ]; dontConfigure = true; dontBuild = true; diff --git a/home/syncthing.nix b/home/syncthing.nix index 6e23142..034db8e 100644 --- a/home/syncthing.nix +++ b/home/syncthing.nix @@ -6,20 +6,7 @@ # Devices: poppy (this mac) + remote (UCWTYQI-...) home.packages = [ pkgs.syncthing ]; - # Autostart via launchd - # -no-browser: don't open GUI on startup - # KeepAlive: restart if crashes - # RunAtLoad: start at login - launchd.agents.syncthing = { - enable = true; - config = { - ProgramArguments = [ - "${pkgs.syncthing}/bin/syncthing" - "serve" - ]; - RunAtLoad = true; - KeepAlive = true; - ProcessType = "Background"; - }; - }; + # Autostart is declared in hosts/poppy/default.nix via nix-darwin's + # launchd.user.agents. Home Manager only provides the package here; + # nix-darwin owns the LaunchAgent lifecycle and bootstraps it at login. } diff --git a/hosts/poppy/apps.nix b/hosts/poppy/apps.nix index 234ed6d..5cfca7d 100644 --- a/hosts/poppy/apps.nix +++ b/hosts/poppy/apps.nix @@ -41,11 +41,8 @@ ]; }; - # Nix GUI пакеты (нет в brew) - # pureref — только x86_64-darwin, не работает на M1 - # aseprite — в nixpkgs, но компилируется с нуля (10-30 мин на M1) - # раскомментировать после первой полной сборки (см. docs/apps.md) environment.systemPackages = with pkgs; [ + mihomo # clash-meta ядро: прокси + AWG outbound, конфиг YAML + REST API (GUI-клиенты mihomo в nixpkgs linux-only) # aseprite # пиксельный редактор (uncomment after first build) ]; } diff --git a/hosts/poppy/default.nix b/hosts/poppy/default.nix index 54f508f..68ddd45 100644 --- a/hosts/poppy/default.nix +++ b/hosts/poppy/default.nix @@ -9,6 +9,22 @@ nixpkgs.config.allowUnfree = true; nix.enable = false; + # Syncthing должен быть именно nix-darwin LaunchAgent: home-manager + # создавал plist, но после логина launchd его не всегда bootstrap'ил. + # nix-darwin управляет lifecycle user agent и загружает его при логине. + launchd.user.agents.syncthing = { + serviceConfig = { + Label = "org.nix-community.home.syncthing"; + ProgramArguments = [ + "${pkgs.syncthing}/bin/syncthing" + "serve" + ]; + RunAtLoad = true; + KeepAlive = true; + ProcessType = "Background"; + }; + }; + # Автоматический сбор мусора: удалять пути старше 14 дней, по ночам в 3:00. # nix.gc не работает с nix.enable=false, поэтому launchd-агент напрямую. launchd.user.agents.nix-gc = {