From 04171febf1ad49f2a64d3eb7db7bc3f54a39a20e Mon Sep 17 00:00:00 2001 From: Emma Thorpe Date: Mon, 29 Jun 2026 14:05:32 +0100 Subject: [PATCH] feat(work): load kube-tmux from a pinned flake input kube-tmux is not in nixpkgs, so add the upstream repo as a flake = false input and reference ${inputs.kube-tmux}/kube.tmux directly. The script is now always in the store, so the previous $HOME/code/kube-tmux existence guard is removed and the tmux status line no longer depends on a manual checkout. Refs #50 --- flake.lock | 17 +++++++++++++++++ flake.nix | 7 +++++++ users/emmathorpe/work.nix | 13 +++++++++---- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 21b3b7d..8f2afd1 100644 --- a/flake.lock +++ b/flake.lock @@ -191,6 +191,22 @@ "type": "github" } }, + "kube-tmux": { + "flake": false, + "locked": { + "lastModified": 1779714285, + "narHash": "sha256-l1wjg2ReWKCI7h/K11vvX2ykYTs/mVD+tfz/mQsjn/E=", + "owner": "jonmosco", + "repo": "kube-tmux", + "rev": "8b7e1d127c16b6dc87ff5743f4d775b245198b69", + "type": "github" + }, + "original": { + "owner": "jonmosco", + "repo": "kube-tmux", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -373,6 +389,7 @@ "flake-parts": "flake-parts", "git-hooks": "git-hooks", "home-manager": "home-manager", + "kube-tmux": "kube-tmux", "nix-darwin": "nix-darwin", "nix-homebrew": "nix-homebrew", "nix-index-database": "nix-index-database", diff --git a/flake.nix b/flake.nix index 3e65810..87bc70d 100644 --- a/flake.nix +++ b/flake.nix @@ -60,6 +60,13 @@ url = "github:NixOS/nixos-hardware"; inputs.nixpkgs.follows = "nixpkgs"; }; + # kube-tmux: kube context/namespace for the tmux status line on the work + # host. Not in nixpkgs and not a flake -- pinned here as a plain source so + # the script is always in the store (no manual checkout). See work.nix. + kube-tmux = { + url = "github:jonmosco/kube-tmux"; + flake = false; + }; }; outputs = diff --git a/users/emmathorpe/work.nix b/users/emmathorpe/work.nix index a68d816..1b76ffc 100644 --- a/users/emmathorpe/work.nix +++ b/users/emmathorpe/work.nix @@ -1,6 +1,11 @@ # Work (EDaaS/WSL) home profile: corporate toolchain + tmux tweaks. Git identity # comes from the registry (users/registry.nix), not here. -{ pkgs, lib, ... }: +{ + pkgs, + lib, + inputs, + ... +}: { # Host-scoped extras for this machine only (the EDaaS/WSL host). @@ -47,10 +52,10 @@ docker = "/run/current-system/sw/bin/docker"; }; programs.tmux = { - # kube-tmux is an external checkout; guard on its presence so the status - # line degrades gracefully (no per-refresh error) when it isn't cloned. + # kube context/namespace in the status line. kube-tmux is pinned as a flake + # input (it is not in nixpkgs), so the script is always present in the store. extraConfig = '' - set -g status-right "#(if [ -f $HOME/code/kube-tmux/kube.tmux ]; then /run/current-system/sw/bin/bash $HOME/code/kube-tmux/kube.tmux 250 red black; fi)" + set -g status-right "#(${pkgs.bash}/bin/bash ${inputs.kube-tmux}/kube.tmux 250 red black)" ''; }; programs.go = {