Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
82fac22
feat(agents): add git worktrees rule
khaykingleb Aug 6, 2026
fdfb87d
feat(agents): weekly-cycle-update skill
khaykingleb Aug 6, 2026
3b30f63
chore: update code review skill
khaykingleb Aug 6, 2026
3da67f5
refactor: :hammer:
khaykingleb Aug 7, 2026
aa065d9
fix(homebrew): track brew 6.0.15 update
khaykingleb Aug 8, 2026
dc146ef
fix(homebrew): rename Linear cask
khaykingleb Aug 8, 2026
7bb5d8e
chore(deps): update flake inputs
khaykingleb Aug 8, 2026
05bb789
refactor(home-manager): migrate deprecated Git and SSH options
khaykingleb Aug 8, 2026
7954c82
feat(gh): manage stack extension declaratively
khaykingleb Aug 8, 2026
952735b
refactor(asdf): migrate to Go implementation
khaykingleb Aug 8, 2026
1fa23e1
feat(aws): add profile selection helper
khaykingleb Aug 8, 2026
7443ec8
refactor: :hammer:
khaykingleb Aug 8, 2026
756e684
feat(finicky): route work links to Chrome work profile
khaykingleb Aug 8, 2026
724d6bb
feat(kubie): add context name completion
khaykingleb Aug 8, 2026
9966a28
refactor(tooling): streamline runtime version management
khaykingleb Aug 8, 2026
a86b4dc
refactor: :hammer:
khaykingleb Aug 8, 2026
8553b9d
feat(git): prune during fetching
khaykingleb Aug 8, 2026
88e120d
feat(git): cleanup-branches alias introduction
khaykingleb Aug 8, 2026
c761a6c
refactor: :hammer:
khaykingleb Aug 8, 2026
5ae9cde
feat(nix): adopt nh for system management
khaykingleb Aug 8, 2026
174b0db
fix(nix): remove invalid upgrade recipe
khaykingleb Aug 8, 2026
e264aa6
docs(readme): update setup and usage workflow
khaykingleb Aug 8, 2026
2fb1b3f
refactor(hosts): rename systems directory
khaykingleb Aug 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 41 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Agent rules, skills, and MCP servers are defined once in `users/shared/programs/
| --------------- | ----------------------------------------------- |
| `flake.nix` | Inputs and `darwinConfigurations` for each host |
| `modules/` | System-level configuration and the package set |
| `systems/` | Per-host configuration, keyed by hostname |
| `hosts/` | Per-host configuration, keyed by hostname |
| `users/shared/` | Program configuration shared across users |
| `users/<name>/` | Per-user overrides |

Expand All @@ -28,29 +28,62 @@ Agent rules, skills, and MCP servers are defined once in `users/shared/programs/
1. Install Nix using the [Determinate Systems installer](https://install.determinate.systems/):

```shell
just nix-install
curl --proto '=https' --tlsv1.2 -sSf -L \
https://install.determinate.systems/nix |
sh -s -- install
```

Restart the shell after installation.

2. Clone the repository:

```shell
git clone https://github.com/khaykingleb/dotfiles.git ~/.config/dotfiles
cd ~/.config/dotfiles
```

3. Apply the configuration for your machine:
3. Bootstrap the configuration for your machine:

```shell
just nix-apply <hostname>
sudo nix run nix-darwin -- switch \
--flake .#<hostname> \
--show-trace
```

where `<hostname>` is one of the systems defined in `flake.nix` (e.g. `macbook-pro-m4`).

4. Start a new shell, then reconcile the asdf-managed tools:

```shell
./users/shared/programs/asdf/install.sh
```

5. Install the repository hooks:

```shell
just pre-commit-init
```

The initial activation installs `nh` and the asdf runtime. Subsequent configuration changes use the Just recipes below.

## Usage

```shell
just # list all available commands
just nix-apply <hostname> # apply configuration
just nix-update-flake # update flake inputs
just nix-gc # garbage collect unused packages
just # list all available commands
just nix-apply <hostname> # build, diff, and apply a host
just nix-update-flake # update all flake inputs
just nix-update-flake nixpkgs # update selected flake inputs
just nix-clean # clean old generations, keeping recent rollbacks
just asdf-sync # reconcile asdf plugins and versions
just pre-commit-init # install pre-commit and commit-msg hooks
just pre-commit-update # update hook revisions
just pre-commit-run # run all hooks
```

## Uninstall

Remove the Determinate Nix installation explicitly:

```shell
/nix/nix-installer uninstall
```
57 changes: 29 additions & 28 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@
};

# Integrates homebrew with nix-darwin
# https://github.com/zhaofengli-wip/nix-homebrew
# https://github.com/zhaofengli/nix-homebrew
nix-homebrew = {
# TODO: Return to github:zhaofengli/nix-homebrew after
# https://github.com/zhaofengli/nix-homebrew/pull/167 is merged.
type = "github";
owner = "zhaofengli-wip";
owner = "zhaofengli";
repo = "nix-homebrew";
inputs.nixpkgs.follows = "nixpkgs";
ref = "pull/167/head";
};

homebrew-bundle = {
Expand Down Expand Up @@ -121,7 +123,7 @@
autoMigrate = true;
};
}
./systems/${name}
./hosts/${name}
];
};
forAllSystems = nixpkgs.lib.genAttrs systems;
Expand Down
File renamed without changes.
File renamed without changes.
51 changes: 10 additions & 41 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,20 @@
default:
@just --list --unsorted --list-heading $'Available commands:\n'

DS_NIX_INSTALLER_VERSION := "v0.32.2"

[group('nix')]
[doc('Install Nix with Determinate Systems Nix Installer')]
nix-install:
@echo "Installing Nix using Determinate Systems installer ({{ DS_NIX_INSTALLER_VERSION }})."
@if command -v nix >/dev/null 2>&1; then \
echo "Nix is already installed. Run 'nix --version' to check version."; \
else \
curl --proto '=https' --tlsv1.2 -sSf -L "https://install.determinate.systems/nix/tag/{{ DS_NIX_INSTALLER_VERSION }}" | sh -s -- install && \
echo "Nix installation complete. Please restart your shell."; \
fi

[group('nix')]
[doc('Upgrade Nix')]
nix-upgrade:
@echo "Upgrading Nix."
@sudo -i nix upgrade-nix

[group('nix')]
[doc('Uninstall Nix')]
nix-uninstall:
@echo "Uninstalling Nix."
@/nix/nix-installer uninstall

[group('nix')]
[doc('Apply nix-darwin configuration for a given host')]
nix-apply host:
@echo "Applying nix-darwin configuration for {{ host }}."
@sudo nix run nix-darwin -- switch --flake .#{{ host }} --show-trace

[group('nix')]
[doc('Update the flake.lock file')]
nix-update-flake:
@nix flake update
@nh darwin switch . -H {{ host }}

[group('nix')]
[doc('Collect Nix garbage (remove unused packages)')]
nix-gc:
@nix-collect-garbage
[doc('Update all or selected flake inputs')]
nix-update-flake *inputs='':
@nix flake update {{ inputs }}

[group('nix')]
[doc('Delete all non-current Nix generations and collect garbage (removes rollback history)')]
nix-gc-delete-generations:
@sudo nix-collect-garbage -d
[doc('Clean old Nix generations while preserving recent rollback history')]
nix-clean:
@nh clean all --keep 5 --keep-since 7d

[group('misc')]
[doc('Initialize pre-commit hooks')]
Expand All @@ -66,6 +35,6 @@ pre-commit-run:
@pre-commit run --all-files

[group('misc')]
[doc('Install asdf plugins')]
asdf-install:
@./users/shared/scripts/asdf.sh
[doc('Reconcile asdf plugins and tool versions')]
asdf-sync:
@./users/shared/programs/asdf/install.sh
3 changes: 0 additions & 3 deletions modules/common/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
neovim

# VCS
git
diff-so-fancy # git diff formatter
gh # github cli
act # run github actions locally
dvc # data version control for ML

Expand Down
3 changes: 2 additions & 1 deletion modules/darwin/homebrew.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ let
"1password"

# Productivity
"linear-linear"
"finicky"
"linear"
"miro"

# Kubernetes
Expand Down
7 changes: 6 additions & 1 deletion users/gkhaykin/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{ inputs, pkgs, ... }:
{
inputs,
pkgs,
...
}:
{
imports = [
../shared/programs
./onepassword.nix
./programs/finicky.nix
./programs/vscode

../shared/completions.nix
Expand Down
10 changes: 10 additions & 0 deletions users/gkhaykin/programs/finicky.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ lib, pkgs, ... }:
lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
# Home Manager has no default-browser option, so use duti (a macOS
# LaunchServices CLI) to register Finicky as the HTTP(S) URL handler.
home.packages = [ pkgs.duti ];
home.file.".finicky.ts".source = ./finicky.ts;
home.activation.setFinickyAsDefaultBrowser = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
run ${lib.getExe pkgs.duti} -s se.johnste.finicky http
'';
}
21 changes: 21 additions & 0 deletions users/gkhaykin/programs/finicky.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @ts-ignore Finicky provides its type declarations after installation.
import type { FinickyConfig } from "/Applications/Finicky.app/Contents/Resources/finicky.d.ts";

export default {
defaultBrowser: "Google Chrome",
handlers: [
{
match: finicky.matchHostnames([
"together.ai",
/\.together\.ai$/,
"together-ai.okta.com",
/\.awsapps\.com$/,
/^oidc\..+\.amazonaws\.com$/,
]),
browser: {
name: "Google Chrome",
profile: "Together",
},
},
],
} satisfies FinickyConfig;
Loading