Skip to content

coder: fix gh token on login#5687

Merged
Mic92 merged 1 commit into
mainfrom
coder-gh-token
Jun 30, 2026
Merged

coder: fix gh token on login#5687
Mic92 merged 1 commit into
mainfrom
coder-gh-token

Conversation

@Mic92

@Mic92 Mic92 commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Why

On coder workspaces $HOME is wiped on every restart, taking ~/.config/nix/secrets.conf (the !included GitHub token for nix.conf) with it. Without the token, flake fetches hit the anonymous GitHub API rate limit.

What

  • coder.nix: add a nix-github-token activation hook that regenerates secrets.conf from gh auth token on each activation. Best-effort — no gh/token means no-op.
  • flake-module.nix: home-manager runs activation with a hermetic PATH, so the hm wrapper now exports HM_HOST_PATH to let hooks reach host tools (here, gh).

Generic: no host-specific paths; degrades to a no-op where gh is absent.

@Mic92 Mic92 enabled auto-merge June 30, 2026 11:33
@Mic92 Mic92 merged commit 69f9a06 into main Jun 30, 2026
4 checks passed
@Mic92 Mic92 deleted the coder-gh-token branch June 30, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant