From 41c10ace84b4019daf33ffe2ba76353b519cd188 Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Wed, 31 Jul 2024 17:00:35 +0800 Subject: [PATCH] Add notes on monorepo dev --- doc/monorepo-tips.md | 26 ++++++++++++++++++++++++++ home.nix | 1 + profile.json | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 doc/monorepo-tips.md diff --git a/doc/monorepo-tips.md b/doc/monorepo-tips.md new file mode 100644 index 0000000..d495936 --- /dev/null +++ b/doc/monorepo-tips.md @@ -0,0 +1,26 @@ +# Managing monorepos: nixpkgs developments made easy + +## sync from upstream + +This ensures minimal blob transfers in a sparse checkout: +```bash +# pin the latest hash from the nixpkgs-unstable channel +nix registry pin nixpkgs + +# find the "$rev" hash by inspecting the cached registry +nix registry list + +# fetch the git "$rev" from the remote +git fetch origin "$rev" + +# bump local master to the "$rev" +git switch master +git reset --hard "$rev" + +# sync github remote with upstream from the web interface, +# and then fetch the upstream "$rev" +git fetch origin master + +# reset the remote master to the channel "$rev" +git push --force +``` diff --git a/home.nix b/home.nix index 4312303..49b9056 100644 --- a/home.nix +++ b/home.nix @@ -60,6 +60,7 @@ let trash-cli git-branchless dust + bottom openssh # need to unset SSH_AUTH_SOCK, maybe # trashy # better, but its zsh completion is broken diff --git a/profile.json b/profile.json index 148cf0b..88dcc4f 100644 --- a/profile.json +++ b/profile.json @@ -15,7 +15,7 @@ "active": true, "priority": 5, "storePaths": [ - "/nix/store/lndb6k43xc67r373v22hck5j58w4ln1j-home-manager-path" + "/nix/store/nwbyv3qmvabr8w65v6j7y1cbk752693y-home-manager-path" ] } },