mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-17 05:00:19 +00:00
linux init
This commit is contained in:
parent
8ed16afd7d
commit
24b16cba14
13 changed files with 338 additions and 209 deletions
17
README.md
17
README.md
|
|
@ -3,7 +3,7 @@
|
||||||
## Approach
|
## Approach
|
||||||
|
|
||||||
This repo is the source of truth for the machine's reproducible developer
|
This repo is the source of truth for the machine's reproducible developer
|
||||||
environment:
|
environment across macOS and Linux:
|
||||||
|
|
||||||
- `home/` contains the Home Manager modules for user-facing tools
|
- `home/` contains the Home Manager modules for user-facing tools
|
||||||
- `config/` contains the repo-owned config trees copied from your daily setup
|
- `config/` contains the repo-owned config trees copied from your daily setup
|
||||||
|
|
@ -12,16 +12,21 @@ environment:
|
||||||
that are still easier to keep in Brew on macOS
|
that are still easier to keep in Brew on macOS
|
||||||
- `home/migration.nix` contains one-time ownership handoff logic from `~/dots`
|
- `home/migration.nix` contains one-time ownership handoff logic from `~/dots`
|
||||||
into Home Manager so the steady-state modules can stay focused on real config
|
into Home Manager so the steady-state modules can stay focused on real config
|
||||||
|
- `lib/package-sets.nix` defines the shared CLI package subsets used by both
|
||||||
|
macOS and Linux hosts
|
||||||
|
|
||||||
## Layout
|
## Layout
|
||||||
|
|
||||||
- `flake.nix`: top-level flake and host wiring
|
- `flake.nix`: top-level flake and host wiring
|
||||||
- `hosts/hari-macbook-pro/default.nix`: this machine's host config
|
- `hosts/hari-macbook-pro/default.nix`: this machine's host config
|
||||||
|
- `hosts/workstation/default.nix`: standalone Linux Home Manager host config
|
||||||
- `modules/base.nix`: Nix settings and core packages
|
- `modules/base.nix`: Nix settings and core packages
|
||||||
- `modules/macos.nix`: macOS defaults and host-level settings
|
- `modules/macos.nix`: macOS defaults and host-level settings
|
||||||
- `modules/packages.nix`: system packages and fonts
|
- `modules/packages.nix`: system packages and fonts
|
||||||
- `modules/homebrew.nix`: the remaining Homebrew-managed GUI apps
|
- `modules/homebrew.nix`: the remaining Homebrew-managed GUI apps
|
||||||
- `home/`: Home Manager modules for shell, editor, CLI tools, and app config
|
- `home/`: Home Manager modules for shell, editor, CLI tools, and app config
|
||||||
|
- `home/common.nix`: shared Home Manager imports used by macOS and Linux
|
||||||
|
- `home/linux.nix`: Linux Home Manager entrypoint
|
||||||
- `home/migration.nix`: transitional cleanup for old `~/dots` symlinks
|
- `home/migration.nix`: transitional cleanup for old `~/dots` symlinks
|
||||||
- `config/`: repo-owned config files consumed by Home Manager
|
- `config/`: repo-owned config files consumed by Home Manager
|
||||||
|
|
||||||
|
|
@ -57,14 +62,22 @@ Bitwarden note:
|
||||||
First switch:
|
First switch:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
nix run github:LnL7/nix-darwin/master#darwin-rebuild -- switch --flake .#hari-macbook-pro
|
nix run github:LnL7/nix-darwin/master#darwin-rebuild -- switch --flake path:.#hari-macbook-pro
|
||||||
|
```
|
||||||
|
|
||||||
|
First Linux switch:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix run github:nix-community/home-manager -- switch --flake path:.#workstation -b hm-bak
|
||||||
```
|
```
|
||||||
|
|
||||||
After the first successful switch:
|
After the first successful switch:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
just switch
|
just switch
|
||||||
|
just switch workstation
|
||||||
just build
|
just build
|
||||||
|
just build workstation
|
||||||
just check
|
just check
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
44
flake.nix
44
flake.nix
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
description = "Rathi's macOS nix-darwin + Home Manager config";
|
description = "Rathi's macOS nix-darwin + Linux Home Manager config";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
@ -38,18 +38,28 @@
|
||||||
nix-homebrew,
|
nix-homebrew,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
system = "aarch64-darwin";
|
darwinSystem = "aarch64-darwin";
|
||||||
|
linuxSystem = "x86_64-linux";
|
||||||
username = "rathi";
|
username = "rathi";
|
||||||
hostname = "hari-macbook-pro";
|
darwinHostname = "hari-macbook-pro";
|
||||||
pkgs = import nixpkgs {inherit system;};
|
linuxHostname = "workstation";
|
||||||
|
darwinPkgs = import nixpkgs {system = darwinSystem;};
|
||||||
|
linuxPkgs = import nixpkgs {
|
||||||
|
system = linuxSystem;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
formatter.${system} = pkgs.alejandra;
|
formatter.${darwinSystem} = darwinPkgs.alejandra;
|
||||||
|
formatter.${linuxSystem} = linuxPkgs.alejandra;
|
||||||
|
|
||||||
darwinConfigurations.${hostname} = nix-darwin.lib.darwinSystem {
|
darwinConfigurations.${darwinHostname} = nix-darwin.lib.darwinSystem {
|
||||||
inherit system;
|
system = darwinSystem;
|
||||||
specialArgs = {inherit inputs self username hostname;};
|
specialArgs = {
|
||||||
|
inherit inputs self username;
|
||||||
|
hostname = darwinHostname;
|
||||||
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/${hostname}
|
./hosts/${darwinHostname}
|
||||||
home-manager.darwinModules.home-manager
|
home-manager.darwinModules.home-manager
|
||||||
nix-homebrew.darwinModules.nix-homebrew
|
nix-homebrew.darwinModules.nix-homebrew
|
||||||
{
|
{
|
||||||
|
|
@ -57,7 +67,10 @@
|
||||||
|
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
home-manager.extraSpecialArgs = {inherit inputs self username hostname;};
|
home-manager.extraSpecialArgs = {
|
||||||
|
inherit inputs self username;
|
||||||
|
hostname = darwinHostname;
|
||||||
|
};
|
||||||
home-manager.backupFileExtension = "hm-bak";
|
home-manager.backupFileExtension = "hm-bak";
|
||||||
home-manager.users.${username} = import ./home;
|
home-manager.users.${username} = import ./home;
|
||||||
|
|
||||||
|
|
@ -70,5 +83,16 @@
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
homeConfigurations.${linuxHostname} = home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = linuxPkgs;
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit inputs self username;
|
||||||
|
hostname = linuxHostname;
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
./hosts/${linuxHostname}
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
24
home/common.nix
Normal file
24
home/common.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./bat.nix
|
||||||
|
./eza.nix
|
||||||
|
./claude.nix
|
||||||
|
./codex.nix
|
||||||
|
./fzf.nix
|
||||||
|
./gcloud.nix
|
||||||
|
./gh.nix
|
||||||
|
./ghostty.nix
|
||||||
|
./git.nix
|
||||||
|
./k9s.nix
|
||||||
|
./lazygit.nix
|
||||||
|
./migration.nix
|
||||||
|
./nvim.nix
|
||||||
|
./scripts.nix
|
||||||
|
./tmux.nix
|
||||||
|
./zsh.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
home.stateVersion = "24.11";
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
xdg.enable = true;
|
||||||
|
}
|
||||||
|
|
@ -1,26 +1,7 @@
|
||||||
{...}: {
|
{...}: {
|
||||||
imports = [
|
imports = [
|
||||||
./bat.nix
|
./common.nix
|
||||||
./eza.nix
|
|
||||||
./claude.nix
|
|
||||||
./codex.nix
|
|
||||||
./fzf.nix
|
|
||||||
./gcloud.nix
|
|
||||||
./gh.nix
|
|
||||||
./ghostty.nix
|
|
||||||
./git.nix
|
|
||||||
./karabiner.nix
|
./karabiner.nix
|
||||||
./k9s.nix
|
|
||||||
./lazygit.nix
|
|
||||||
./migration.nix
|
|
||||||
./nvim.nix
|
|
||||||
./rectangle.nix
|
./rectangle.nix
|
||||||
./scripts.nix
|
|
||||||
./tmux.nix
|
|
||||||
./zsh.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
home.stateVersion = "24.11";
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
xdg.enable = true;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
|
@ -38,8 +39,10 @@
|
||||||
keybind = vim/i=deactivate_key_table
|
keybind = vim/i=deactivate_key_table
|
||||||
keybind = vim/catch_all=ignore
|
keybind = vim/catch_all=ignore
|
||||||
mouse-hide-while-typing = true
|
mouse-hide-while-typing = true
|
||||||
macos-titlebar-style = hidden
|
${lib.optionalString pkgs.stdenv.isDarwin ''
|
||||||
macos-option-as-alt = true
|
macos-titlebar-style = hidden
|
||||||
|
macos-option-as-alt = true
|
||||||
|
''}
|
||||||
confirm-close-surface = true
|
confirm-close-surface = true
|
||||||
window-title-font-family = VictorMono NFM Italic
|
window-title-font-family = VictorMono NFM Italic
|
||||||
window-padding-balance = true
|
window-padding-balance = true
|
||||||
|
|
@ -52,7 +55,10 @@
|
||||||
in {
|
in {
|
||||||
programs.ghostty = {
|
programs.ghostty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.ghostty-bin;
|
package =
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then pkgs.ghostty-bin
|
||||||
|
else pkgs.ghostty;
|
||||||
installBatSyntax = true;
|
installBatSyntax = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -64,8 +70,10 @@ in {
|
||||||
xdg.configFile."ghostty/themes/cozybox-dark".text = theme.renderGhostty "dark";
|
xdg.configFile."ghostty/themes/cozybox-dark".text = theme.renderGhostty "dark";
|
||||||
xdg.configFile."ghostty/themes/cozybox-light".text = theme.renderGhostty "light";
|
xdg.configFile."ghostty/themes/cozybox-light".text = theme.renderGhostty "light";
|
||||||
|
|
||||||
home.file."Library/Application Support/com.mitchellh.ghostty/config.ghostty" = {
|
home.file = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
text = ghosttyConfig;
|
"Library/Application Support/com.mitchellh.ghostty/config.ghostty" = {
|
||||||
force = true;
|
text = ghosttyConfig;
|
||||||
|
force = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,12 @@
|
||||||
{...}: {
|
{
|
||||||
home.file."Library/Application Support/lazygit/config.yml".source =
|
lib,
|
||||||
../config/lazygit/config.yml;
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
xdg.configFile."lazygit/config.yml".source = ../config/lazygit/config.yml;
|
||||||
|
|
||||||
|
home.file = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
"Library/Application Support/lazygit/config.yml".source =
|
||||||
|
../config/lazygit/config.yml;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5
home/linux.nix
Normal file
5
home/linux.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./common.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
86
home/zsh.nix
86
home/zsh.nix
|
|
@ -22,43 +22,53 @@
|
||||||
autosuggestion.enable = true;
|
autosuggestion.enable = true;
|
||||||
syntaxHighlighting.enable = true;
|
syntaxHighlighting.enable = true;
|
||||||
|
|
||||||
shellAliases = {
|
shellAliases =
|
||||||
co = "codex --dangerously-bypass-approvals-and-sandbox";
|
{
|
||||||
ca = "cursor-agent";
|
co = "codex --dangerously-bypass-approvals-and-sandbox";
|
||||||
cc = "claude";
|
ca = "cursor-agent";
|
||||||
ch = "claude-handoff";
|
cc = "claude";
|
||||||
cl = "clear";
|
ch = "claude-handoff";
|
||||||
gc = "git commit";
|
cl = "clear";
|
||||||
gd = "git diff";
|
gc = "git commit";
|
||||||
gk = "git checkout";
|
gd = "git diff";
|
||||||
gp = "git push";
|
gk = "git checkout";
|
||||||
gpo = "git pull origin";
|
gp = "git push";
|
||||||
gs = "git status";
|
gpo = "git pull origin";
|
||||||
ld = "lumen diff";
|
gs = "git status";
|
||||||
lg = "lazygit";
|
ld = "lumen diff";
|
||||||
nim = "nvim .";
|
lg = "lazygit";
|
||||||
sshnet = "ssh -i ~/.ssh/atlas-ssh.txt rathiharivansh@152.53.195.59";
|
nim = "nvim .";
|
||||||
tailscale = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
|
sshnet = "ssh -i ~/.ssh/atlas-ssh.txt rathiharivansh@152.53.195.59";
|
||||||
|
|
||||||
# nix helpers
|
# nix helpers
|
||||||
nr = "nix profile remove"; # nr <index> - remove from profile
|
nr = "nix profile remove"; # nr <index> - remove from profile
|
||||||
ns = "nix search nixpkgs"; # ns <query> - search packages
|
ns = "nix search nixpkgs"; # ns <query> - search packages
|
||||||
nls = "nix profile list"; # nls - list installed profile packages
|
nls = "nix profile list"; # nls - list installed profile packages
|
||||||
nrb = "sudo darwin-rebuild switch --flake ~/Documents/GitHub/nix"; # nrb - rebuild declarative config
|
}
|
||||||
nup = "nix flake update ~/Documents/GitHub/nix && sudo darwin-rebuild switch --flake ~/Documents/GitHub/nix"; # nup - update flake + rebuild
|
// lib.optionalAttrs pkgs.stdenv.isDarwin {
|
||||||
|
tailscale = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
|
||||||
|
nrb = "sudo darwin-rebuild switch --flake path:$HOME/Documents/GitHub/nix#hari-macbook-pro"; # nrb - rebuild declarative config
|
||||||
|
nup = "nix flake update $HOME/Documents/GitHub/nix && sudo darwin-rebuild switch --flake path:$HOME/Documents/GitHub/nix#hari-macbook-pro"; # nup - update flake + rebuild
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs pkgs.stdenv.isLinux {
|
||||||
|
nrb = "nix run github:nix-community/home-manager -- switch --flake path:$HOME/Documents/GitHub/nix#workstation -b hm-bak"; # nrb - rebuild declarative config
|
||||||
|
nup = "nix flake update $HOME/Documents/GitHub/nix && nix run github:nix-community/home-manager -- switch --flake path:$HOME/Documents/GitHub/nix#workstation -b hm-bak"; # nup - update flake + rebuild
|
||||||
};
|
};
|
||||||
|
|
||||||
envExtra = ''
|
envExtra =
|
||||||
if [[ -f "$HOME/.cargo/env" ]]; then
|
''
|
||||||
. "$HOME/.cargo/env"
|
if [[ -f "$HOME/.cargo/env" ]]; then
|
||||||
fi
|
. "$HOME/.cargo/env"
|
||||||
|
fi
|
||||||
# Ghostty shell integration expects a resource directory; the Nix app
|
''
|
||||||
# bundle lives in the store instead of /Applications.
|
+ lib.optionalString pkgs.stdenv.isDarwin ''
|
||||||
export GHOSTTY_RESOURCES_DIR="${pkgs.ghostty-bin}/Applications/Ghostty.app/Contents/Resources/ghostty"
|
# Ghostty shell integration expects a resource directory; the Nix app
|
||||||
|
# bundle lives in the store instead of /Applications.
|
||||||
export MANPAGER="nvim +Man!"
|
export GHOSTTY_RESOURCES_DIR="${pkgs.ghostty-bin}/Applications/Ghostty.app/Contents/Resources/ghostty"
|
||||||
'';
|
''
|
||||||
|
+ ''
|
||||||
|
export MANPAGER="nvim +Man!"
|
||||||
|
'';
|
||||||
|
|
||||||
initContent = lib.mkMerge [
|
initContent = lib.mkMerge [
|
||||||
(lib.mkOrder 550 ''
|
(lib.mkOrder 550 ''
|
||||||
|
|
@ -88,7 +98,11 @@
|
||||||
[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun"
|
[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun"
|
||||||
|
|
||||||
export BUN_INSTALL="$HOME/.bun"
|
export BUN_INSTALL="$HOME/.bun"
|
||||||
export PNPM_HOME="$HOME/Library/pnpm"
|
export PNPM_HOME="${
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then "$HOME/Library/pnpm"
|
||||||
|
else "${config.xdg.dataHome}/pnpm"
|
||||||
|
}"
|
||||||
bindkey -v
|
bindkey -v
|
||||||
typeset -U path PATH
|
typeset -U path PATH
|
||||||
path=(
|
path=(
|
||||||
|
|
@ -103,8 +117,10 @@
|
||||||
"/etc/profiles/per-user/${config.home.username}/bin"
|
"/etc/profiles/per-user/${config.home.username}/bin"
|
||||||
"/run/current-system/sw/bin"
|
"/run/current-system/sw/bin"
|
||||||
"/nix/var/nix/profiles/default/bin"
|
"/nix/var/nix/profiles/default/bin"
|
||||||
|
${lib.optionalString pkgs.stdenv.isDarwin ''
|
||||||
"/opt/homebrew/bin"
|
"/opt/homebrew/bin"
|
||||||
"/opt/homebrew/sbin"
|
"/opt/homebrew/sbin"
|
||||||
|
''}
|
||||||
$path
|
$path
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
21
hosts/workstation/default.nix
Normal file
21
hosts/workstation/default.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
username,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
packageSets = import ../../lib/package-sets.nix {inherit inputs lib pkgs;};
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
../../home/linux.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
targets.genericLinux.enable = true;
|
||||||
|
|
||||||
|
home = {
|
||||||
|
inherit username;
|
||||||
|
homeDirectory = "/home/${username}";
|
||||||
|
packages = packageSets.core ++ packageSets.extras;
|
||||||
|
};
|
||||||
|
}
|
||||||
18
justfile
18
justfile
|
|
@ -4,11 +4,21 @@ default:
|
||||||
check:
|
check:
|
||||||
nix --extra-experimental-features 'nix-command flakes' flake check
|
nix --extra-experimental-features 'nix-command flakes' flake check
|
||||||
|
|
||||||
build:
|
build config='hari-macbook-pro':
|
||||||
nix --extra-experimental-features 'nix-command flakes' build .#darwinConfigurations.hari-macbook-pro.system
|
#!/usr/bin/env bash
|
||||||
|
if [[ "{{config}}" == "hari-macbook-pro" ]]; then
|
||||||
|
nix --extra-experimental-features 'nix-command flakes' build path:.#darwinConfigurations.{{config}}.system
|
||||||
|
else
|
||||||
|
nix --extra-experimental-features 'nix-command flakes' run github:nix-community/home-manager -- build --flake path:.#{{config}}
|
||||||
|
fi
|
||||||
|
|
||||||
switch:
|
switch config='hari-macbook-pro':
|
||||||
sudo env PATH="$PATH" nix --extra-experimental-features 'nix-command flakes' run github:LnL7/nix-darwin/master#darwin-rebuild -- switch --flake .#hari-macbook-pro
|
#!/usr/bin/env bash
|
||||||
|
if [[ "{{config}}" == "hari-macbook-pro" ]]; then
|
||||||
|
sudo env PATH="$PATH" nix --extra-experimental-features 'nix-command flakes' run github:LnL7/nix-darwin/master#darwin-rebuild -- switch --flake path:.#{{config}}
|
||||||
|
else
|
||||||
|
nix --extra-experimental-features 'nix-command flakes' run github:nix-community/home-manager -- switch --flake path:.#{{config}} -b hm-bak
|
||||||
|
fi
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
nix --extra-experimental-features 'nix-command flakes' fmt
|
nix --extra-experimental-features 'nix-command flakes' fmt
|
||||||
|
|
|
||||||
139
lib/package-sets.nix
Normal file
139
lib/package-sets.nix
Normal file
|
|
@ -0,0 +1,139 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
}: let
|
||||||
|
gwsPackage =
|
||||||
|
inputs.googleworkspace-cli.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||||
|
claudePackage =
|
||||||
|
inputs.claudeCode.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||||
|
|
||||||
|
memex = pkgs.stdenvNoCC.mkDerivation rec {
|
||||||
|
pname = "memex";
|
||||||
|
version = "0.3.1";
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://github.com/nicosuave/memex/releases/download/v${version}/memex-${version}-macos-arm64.tar.gz";
|
||||||
|
hash = "sha256-OIqT0xS+8vc0dQNi+YdDXLmN8V/7AT4Q/cnvbbhZ+3s=";
|
||||||
|
};
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
tar -xzf "$src"
|
||||||
|
install -Dm755 memex "$out/bin/memex"
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Fast local history search for Claude and Codex logs";
|
||||||
|
homepage = "https://github.com/nicosuave/memex";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
mainProgram = "memex";
|
||||||
|
platforms = lib.platforms.darwin;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
graphite = pkgs.stdenvNoCC.mkDerivation rec {
|
||||||
|
pname = "graphite";
|
||||||
|
version = "1.7.20";
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://github.com/withgraphite/homebrew-tap/releases/download/v${version}/gt-macos-arm64";
|
||||||
|
hash = "sha256-ho9VQw1ic3jhG3yxNwUL0W1WvNFku9zw6DQnGehs7+8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
install -Dm755 "$src" "$out/bin/gt"
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Manage stacked Git changes and submit them for review";
|
||||||
|
homepage = "https://graphite.dev/";
|
||||||
|
license = lib.licenses.agpl3Only;
|
||||||
|
mainProgram = "gt";
|
||||||
|
platforms = lib.platforms.darwin;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
worktrunk = pkgs.rustPlatform.buildRustPackage rec {
|
||||||
|
pname = "worktrunk";
|
||||||
|
version = "0.23.1";
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://github.com/max-sixty/worktrunk/archive/refs/tags/v${version}.tar.gz";
|
||||||
|
hash = "sha256-cdQDUz7to3JkriWE9i5iJ2RftJFZivw7CTwGxDZPAqw=";
|
||||||
|
};
|
||||||
|
|
||||||
|
cargoHash = "sha256-DHjwNqMiVkWqL3CuOCITvyqkdKe+GOZ2nlMSstDIcTg=";
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "CLI for Git worktree management";
|
||||||
|
homepage = "https://worktrunk.dev";
|
||||||
|
license = with lib.licenses; [asl20 mit];
|
||||||
|
mainProgram = "wt";
|
||||||
|
platforms = lib.platforms.darwin;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
core = with pkgs; [
|
||||||
|
curl
|
||||||
|
fd
|
||||||
|
fzf
|
||||||
|
gnupg
|
||||||
|
go_1_26
|
||||||
|
jq
|
||||||
|
just
|
||||||
|
nodejs_22
|
||||||
|
python3
|
||||||
|
ripgrep
|
||||||
|
rustup
|
||||||
|
tree
|
||||||
|
uv
|
||||||
|
wget
|
||||||
|
zoxide
|
||||||
|
];
|
||||||
|
|
||||||
|
extras =
|
||||||
|
(with pkgs; [
|
||||||
|
awscli2
|
||||||
|
claudePackage
|
||||||
|
coreutils-prefixed
|
||||||
|
delta
|
||||||
|
diff-so-fancy
|
||||||
|
git-filter-repo
|
||||||
|
git-lfs
|
||||||
|
goose
|
||||||
|
google-cloud-sdk
|
||||||
|
gwsPackage
|
||||||
|
imagemagickBig
|
||||||
|
kind
|
||||||
|
kubectl
|
||||||
|
kubernetes-helm
|
||||||
|
lazygit
|
||||||
|
libpq
|
||||||
|
librsvg
|
||||||
|
llmfit
|
||||||
|
mise
|
||||||
|
minikube
|
||||||
|
ngrok
|
||||||
|
postgresql_17
|
||||||
|
redis
|
||||||
|
tailscale
|
||||||
|
terraform
|
||||||
|
texliveFull
|
||||||
|
yt-dlp
|
||||||
|
])
|
||||||
|
++ lib.optionals pkgs.stdenv.isDarwin [
|
||||||
|
graphite
|
||||||
|
memex
|
||||||
|
worktrunk
|
||||||
|
];
|
||||||
|
|
||||||
|
fonts = with pkgs; [
|
||||||
|
jetbrains-mono
|
||||||
|
nerd-fonts.symbols-only
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,12 @@
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
username,
|
username,
|
||||||
...
|
...
|
||||||
}: {
|
}: let
|
||||||
|
packageSets = import ../lib/package-sets.nix {inherit inputs lib pkgs;};
|
||||||
|
in {
|
||||||
nix.enable = true;
|
nix.enable = true;
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
|
|
@ -31,23 +35,7 @@
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
environment.shells = [pkgs.zsh];
|
environment.shells = [pkgs.zsh];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = packageSets.core;
|
||||||
curl
|
|
||||||
fd
|
|
||||||
fzf
|
|
||||||
gnupg
|
|
||||||
go_1_26
|
|
||||||
jq
|
|
||||||
just
|
|
||||||
nodejs_22
|
|
||||||
python3
|
|
||||||
ripgrep
|
|
||||||
rustup
|
|
||||||
tree
|
|
||||||
uv
|
|
||||||
wget
|
|
||||||
zoxide
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
|
|
|
||||||
|
|
@ -4,116 +4,8 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
gwsPackage =
|
packageSets = import ../lib/package-sets.nix {inherit inputs lib pkgs;};
|
||||||
inputs.googleworkspace-cli.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
|
||||||
claudePackage =
|
|
||||||
inputs.claudeCode.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
|
||||||
|
|
||||||
memex = pkgs.stdenvNoCC.mkDerivation rec {
|
|
||||||
pname = "memex";
|
|
||||||
version = "0.3.1";
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url = "https://github.com/nicosuave/memex/releases/download/v${version}/memex-${version}-macos-arm64.tar.gz";
|
|
||||||
hash = "sha256-OIqT0xS+8vc0dQNi+YdDXLmN8V/7AT4Q/cnvbbhZ+3s=";
|
|
||||||
};
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
tar -xzf "$src"
|
|
||||||
install -Dm755 memex "$out/bin/memex"
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Fast local history search for Claude and Codex logs";
|
|
||||||
homepage = "https://github.com/nicosuave/memex";
|
|
||||||
license = lib.licenses.mit;
|
|
||||||
mainProgram = "memex";
|
|
||||||
platforms = lib.platforms.darwin;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
graphite = pkgs.stdenvNoCC.mkDerivation rec {
|
|
||||||
pname = "graphite";
|
|
||||||
version = "1.7.20";
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url = "https://github.com/withgraphite/homebrew-tap/releases/download/v${version}/gt-macos-arm64";
|
|
||||||
hash = "sha256-ho9VQw1ic3jhG3yxNwUL0W1WvNFku9zw6DQnGehs7+8=";
|
|
||||||
};
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
install -Dm755 "$src" "$out/bin/gt"
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Manage stacked Git changes and submit them for review";
|
|
||||||
homepage = "https://graphite.dev/";
|
|
||||||
license = lib.licenses.agpl3Only;
|
|
||||||
mainProgram = "gt";
|
|
||||||
platforms = lib.platforms.darwin;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
worktrunk = pkgs.rustPlatform.buildRustPackage rec {
|
|
||||||
pname = "worktrunk";
|
|
||||||
version = "0.23.1";
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url = "https://github.com/max-sixty/worktrunk/archive/refs/tags/v${version}.tar.gz";
|
|
||||||
hash = "sha256-cdQDUz7to3JkriWE9i5iJ2RftJFZivw7CTwGxDZPAqw=";
|
|
||||||
};
|
|
||||||
|
|
||||||
cargoHash = "sha256-DHjwNqMiVkWqL3CuOCITvyqkdKe+GOZ2nlMSstDIcTg=";
|
|
||||||
doCheck = false;
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "CLI for Git worktree management";
|
|
||||||
homepage = "https://worktrunk.dev";
|
|
||||||
license = with lib.licenses; [asl20 mit];
|
|
||||||
mainProgram = "wt";
|
|
||||||
platforms = lib.platforms.darwin;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = packageSets.extras;
|
||||||
awscli2
|
fonts.packages = packageSets.fonts;
|
||||||
claudePackage
|
|
||||||
coreutils-prefixed
|
|
||||||
delta
|
|
||||||
diff-so-fancy
|
|
||||||
git-filter-repo
|
|
||||||
git-lfs
|
|
||||||
goose
|
|
||||||
graphite
|
|
||||||
google-cloud-sdk
|
|
||||||
gwsPackage
|
|
||||||
kubernetes-helm
|
|
||||||
imagemagickBig
|
|
||||||
kind
|
|
||||||
kubectl
|
|
||||||
lazygit
|
|
||||||
libpq
|
|
||||||
librsvg
|
|
||||||
llmfit
|
|
||||||
memex
|
|
||||||
mise
|
|
||||||
minikube
|
|
||||||
ngrok
|
|
||||||
postgresql_17
|
|
||||||
redis
|
|
||||||
tailscale
|
|
||||||
terraform
|
|
||||||
texliveFull
|
|
||||||
worktrunk
|
|
||||||
yt-dlp
|
|
||||||
];
|
|
||||||
|
|
||||||
fonts.packages = with pkgs; [
|
|
||||||
jetbrains-mono
|
|
||||||
nerd-fonts.symbols-only
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue