File tree Expand file tree Collapse file tree
home-manager/bcnelson/_mixins/happy Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 nixpkgs-unstable . url = "github:nixos/nixpkgs/nixos-unstable" ;
1111 nixpkgs-unstable-small . url = "github:nixos/nixpkgs/nixos-unstable-small" ;
1212
13+ # happy-coder PR #492656 — monorepo migration. Remove once merged into unstable.
14+ nixpkgs-happy-coder . url = "github:colonelpanic8/nixpkgs/happy-coder-monorepo-migration" ;
15+
1316 # Home manager - always use unstable
1417 home-manager-unstable . url = "github:nix-community/home-manager/master" ;
1518 home-manager-unstable . inputs . nixpkgs . follows = "nixpkgs-unstable" ;
Original file line number Diff line number Diff line change 88 nativeBuildInputs = [ pkgs . makeWrapper ] ;
99 postBuild = ''
1010 wrapProgram $out/bin/happy \
11- --set-default HAPPY_HOME_DIR ${ happyHomeDir }
11+ --set-default HAPPY_HOME_DIR ${ happyHomeDir } \
12+ --set-default HAPPY_CLAUDE_PATH ${ pkgs . claude-code-bin } /bin/claude
1213 wrapProgram $out/bin/happy-mcp \
13- --set-default HAPPY_HOME_DIR ${ happyHomeDir }
14+ --set-default HAPPY_HOME_DIR ${ happyHomeDir } \
15+ --set-default HAPPY_CLAUDE_PATH ${ pkgs . claude-code-bin } /bin/claude
1416 '' ;
1517 inherit ( pkgs . happy-coder ) meta ;
1618 } ;
Original file line number Diff line number Diff line change 1515
1616 authNotifyPackage = lib . mkPackageOption pkgs "happy-auth-notify" { } ;
1717
18+ claudePackage = lib . mkPackageOption pkgs "claude-code-bin" { } ;
19+
1820 happyHomeDir = lib . mkOption {
1921 type = lib . types . str ;
2022 default = "/home/${ cfg . user } /.local/share/happy" ;
6062 Environment = [
6163 "HOME=/home/${ cfg . user } "
6264 "HAPPY_HOME_DIR=${ cfg . happyHomeDir } "
65+ "HAPPY_CLAUDE_PATH=${ cfg . claudePackage } /bin/claude"
6366 ] ;
6467 ExecStart = "${ cfg . package } /bin/happy daemon start-sync" ;
6568 Restart = "on-failure" ;
Original file line number Diff line number Diff line change 99 # https://nixos.wiki/wiki/Overlays
1010 modifications = final : prev : {
1111 # libsForQt5.sddm = nixpkgs-unstable.libsForQt5.sddm;
12+
13+ # happy-coder PR #492656 — monorepo migration, pre-merge testing.
14+ # Remove once the PR lands in nixpkgs-unstable.
15+ # The PR's wrapper invokes node by absolute path but the CLI spawns child
16+ # `node` processes via PATH lookup (e.g. `happy daemon start-sync`),
17+ # so add nodejs to PATH here.
18+ happy-coder = ( inputs . nixpkgs-happy-coder . legacyPackages . ${ final . stdenv . hostPlatform . system } . happy-coder ) . overrideAttrs ( old : {
19+ nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ final . makeWrapper ] ;
20+ postFixup = ( old . postFixup or "" ) + ''
21+ wrapProgram $out/bin/happy \
22+ --prefix PATH : ${ final . lib . makeBinPath [ final . nodejs ] }
23+ wrapProgram $out/bin/happy-mcp \
24+ --prefix PATH : ${ final . lib . makeBinPath [ final . nodejs ] }
25+ '' ;
26+ } ) ;
27+
1228 claude-code-bin = prev . claude-code-bin . overrideAttrs ( oldAttrs : {
1329 postFixup = ( oldAttrs . postFixup or "" ) + ''
1430 wrapProgram $out/bin/claude \
You can’t perform that action at this time.
0 commit comments