From d5d62393e31a31ccf46b9374920806c0b4242efe Mon Sep 17 00:00:00 2001 From: oqyude Date: Fri, 7 Aug 2026 03:35:19 +0300 Subject: [PATCH] termux: create .nix-defexpr/channels/nixpkgs/.keep via activation (home-manager cannot link into symlinked dir) --- home/termux.nix | 4 ---- modules/termux/default.nix | 11 +++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/home/termux.nix b/home/termux.nix index 8fce3b3..cfa3d92 100644 --- a/home/termux.nix +++ b/home/termux.nix @@ -62,10 +62,6 @@ ".ssh/authorized_keys".text = '' ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKduJia+unaQQdN6X5syaHvnpIutO+yZwvfiCP4qKQ/P ''; - # nix-on-droid's session-init adds ~/.nix-defexpr/channels to NIX_PATH - # unconditionally; nix warns about the missing dir on every invocation. - # Making it exist silences the warning. - ".nix-defexpr/channels/nixpkgs/.keep".text = ""; }; }; programs = { diff --git a/modules/termux/default.nix b/modules/termux/default.nix index b182cb8..6cbd77b 100644 --- a/modules/termux/default.nix +++ b/modules/termux/default.nix @@ -49,6 +49,17 @@ in fi ''; + # nix-on-droid's session-init adds ~/.nix-defexpr/channels to NIX_PATH + # unconditionally; nix warns about the missing dir on every invocation. + # Making it exist silences the warning. Must be done in activation (not + # home-manager): ~/.nix-defexpr/channels is a symlink into + # ~/.local/state/nix/profiles/channels, which home-manager cannot link + # into. + build.activation.nixdefexpr = '' + $DRY_RUN_CMD mkdir -p "${config.user.home}/.nix-defexpr/channels/nixpkgs" + $DRY_RUN_CMD touch "${config.user.home}/.nix-defexpr/channels/nixpkgs/.keep" + ''; + # runit service tree: ~/service//{run,log/run}. run/ and log/run are # symlinks into the nix store (read-only is fine; runsvdir writes only to # the /supervise dirs). /etc/service is symlinked for `sv status`.