ci + lint

This commit is contained in:
Harivansh Rathi 2026-03-30 00:28:59 -04:00
parent d088a98954
commit 66d9b25682
39 changed files with 395 additions and 225 deletions

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
programs.bat = {
enable = true;

View file

@ -2,10 +2,11 @@
inputs,
pkgs,
...
}: let
claudePackage =
inputs.claudeCode.packages.${pkgs.stdenv.hostPlatform.system}.default;
in {
}:
let
claudePackage = inputs.claudeCode.packages.${pkgs.stdenv.hostPlatform.system}.default;
in
{
# Keep the managed Claude binary on the same path the live machine was using
# so the Nix package cleanly replaces the prior manual install.
home.file.".local/bin/claude".source = "${claudePackage}/bin/claude";

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
home.file.".codex/AGENTS.md".source = ../config/codex/AGENTS.md;
home.file.".codex/config.toml".source = ../config/codex/config.toml;
}

View file

@ -2,9 +2,11 @@
config,
pkgs,
...
}: let
}:
let
defaultProfile = "default";
in {
in
{
home.packages = with pkgs; [
docker-buildx
docker-client

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
imports = [
./bat.nix
./eza.nix

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
imports = [
./common.nix
./colima.nix

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
programs.eza = {
enable = true;
enableZshIntegration = true;

View file

@ -1,6 +1,8 @@
{config, ...}: let
theme = import ../lib/theme.nix {inherit config;};
in {
{ config, ... }:
let
theme = import ../lib/theme.nix { inherit config; };
in
{
home.sessionVariables = {
FZF_DEFAULT_OPTS_FILE = theme.paths.fzfCurrentFile;
};

View file

@ -1,7 +1,8 @@
{lib, ...}: {
{ lib, ... }:
{
xdg.configFile."gcloud/active_config".text = "default\n";
xdg.configFile."gcloud/configurations/config_default".text = lib.generators.toINI {} {
xdg.configFile."gcloud/configurations/config_default".text = lib.generators.toINI { } {
core = {
account = "rathiharivansh@gmail.com";
project = "hari-gc";

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
programs.gh = {
enable = true;
gitCredentialHelper.enable = true;

View file

@ -3,8 +3,9 @@
lib,
pkgs,
...
}: let
theme = import ../lib/theme.nix {inherit config;};
}:
let
theme = import ../lib/theme.nix { inherit config; };
ghosttyConfig = ''
theme = "cozybox-current"
font-family = Berkeley Mono
@ -52,13 +53,11 @@
focus-follows-mouse = true
link-url = true
'';
in {
in
{
programs.ghostty = {
enable = true;
package =
if pkgs.stdenv.isDarwin
then pkgs.ghostty-bin
else pkgs.ghostty;
package = if pkgs.stdenv.isDarwin then pkgs.ghostty-bin else pkgs.ghostty;
installBatSyntax = true;
};

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
programs.git = {
enable = true;
lfs.enable = true;

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
programs.k9s = {
enable = true;

View file

@ -2,11 +2,12 @@
config,
lib,
...
}: {
}:
{
# Karabiner-Elements destroys file-level symlinks (unlink + rewrite), but
# directory-level symlinks survive. Point ~/.config/karabiner at the repo
# directory so changes are tracked in git and Karabiner can write freely.
home.activation.karabinerConfig = lib.hm.dag.entryAfter ["writeBoundary"] ''
home.activation.karabinerConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
karabiner_link="${config.home.homeDirectory}/.config/karabiner"
karabiner_src="/Users/rathi/Documents/GitHub/nix/config/karabiner"

View file

@ -2,11 +2,11 @@
lib,
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;
"Library/Application Support/lazygit/config.yml".source = ../config/lazygit/config.yml;
};
}

View file

@ -1,8 +1,9 @@
{lib, ...}: {
{ lib, ... }:
{
# Transitional cleanup for files previously owned by ~/dots. Keeping this
# separate from steady-state modules makes it obvious what can be deleted
# once every managed path has been fully handed over to Home Manager.
home.activation.removeLegacyZshLinks = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
home.activation.removeLegacyZshLinks = lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
for path in "$HOME/.zshenv" "$HOME/.zshrc"; do
if [ -L "$path" ]; then
target="$(readlink "$path")"
@ -15,7 +16,7 @@
done
'';
home.activation.removeLegacyTmuxLink = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
home.activation.removeLegacyTmuxLink = lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
path="$HOME/.config/tmux/tmux.conf"
if [ -L "$path" ]; then
target="$(readlink "$path")"

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
programs.mise = {
enable = true;
globalConfig = {

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
imports = [
./common.nix
];

View file

@ -3,22 +3,23 @@
lib,
pkgs,
...
}: let
}:
let
nvimConfig = lib.cleanSourceWith {
src = ../config/nvim;
filter = path: type:
builtins.baseNameOf path != ".git"
&& builtins.baseNameOf path != "lazy-lock.json";
filter =
path: type: builtins.baseNameOf path != ".git" && builtins.baseNameOf path != "lazy-lock.json";
};
lazyLockSeed = ../config/nvim/lazy-lock.json;
lazyLockPath = "${config.xdg.stateHome}/nvim/lazy-lock.json";
python = pkgs.writeShellScriptBin "python" ''
exec ${pkgs.python3}/bin/python3 "$@"
'';
in {
in
{
# Keep rust-analyzer in the user profile so it shadows rustup's proxy in
# /run/current-system/sw/bin when Neovim resolves LSP executables.
home.packages = [pkgs.rust-analyzer];
home.packages = [ pkgs.rust-analyzer ];
programs.neovim = {
enable = true;
@ -59,7 +60,7 @@ in {
recursive = true;
};
home.activation.seedNvimLazyLock = lib.hm.dag.entryAfter ["writeBoundary"] ''
home.activation.seedNvimLazyLock = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
state_dir="${config.xdg.stateHome}/nvim"
lockfile="${lazyLockPath}"

View file

@ -1,5 +1,6 @@
{lib, ...}: {
home.activation.importRectanglePreferences = lib.hm.dag.entryAfter ["writeBoundary"] ''
{ lib, ... }:
{
home.activation.importRectanglePreferences = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
/usr/bin/defaults import com.knollsoft.Rectangle ${../config/rectangle/Rectangle.plist}
'';
}

View file

@ -3,12 +3,14 @@
lib,
pkgs,
...
}: let
customScripts = import ../scripts {inherit config lib pkgs;};
in {
}:
let
customScripts = import ../scripts { inherit config lib pkgs; };
in
{
home.packages = builtins.attrValues customScripts.packages;
home.activation.initializeThemeState = lib.hm.dag.entryAfter ["writeBoundary"] ''
home.activation.initializeThemeState = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir -p "${customScripts.theme.paths.stateDir}" "${customScripts.theme.paths.fzfDir}" "${customScripts.theme.paths.ghosttyDir}" "${customScripts.theme.paths.tmuxDir}"
if [[ -f "${customScripts.theme.paths.stateFile}" ]]; then

View file

@ -3,7 +3,8 @@
lib,
pkgs,
...
}: let
}:
let
globalSkills = [
{
name = "rams";
@ -42,8 +43,9 @@
needs_sync=1
fi
'') globalSkills;
in {
home.activation.ensureGlobalSkills = lib.hm.dag.entryAfter ["writeBoundary"] ''
in
{
home.activation.ensureGlobalSkills = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
state_dir="${config.xdg.stateHome}/skills"
stamp_file="$state_dir/global-skills-manifest.sha256"
desired_hash=${lib.escapeShellArg manifestHash}
@ -58,14 +60,16 @@ in {
${missingChecks}
if [ "$needs_sync" -eq 1 ]; then
export PATH="${lib.makeBinPath [
pkgs.nodejs_22
pkgs.git
pkgs.coreutils
pkgs.findutils
pkgs.gnugrep
pkgs.gnused
]}:$PATH"
export PATH="${
lib.makeBinPath [
pkgs.nodejs_22
pkgs.git
pkgs.coreutils
pkgs.findutils
pkgs.gnugrep
pkgs.gnused
]
}:$PATH"
${installCommands}

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
programs.ssh = {
enable = true;
enableDefaultConfig = false;

View file

@ -3,9 +3,11 @@
lib,
pkgs,
...
}: let
theme = import ../lib/theme.nix {inherit config;};
in {
}:
let
theme = import ../lib/theme.nix { inherit config; };
in
{
programs.tmux = {
enable = true;
plugins = with pkgs.tmuxPlugins; [

View file

@ -3,15 +3,15 @@
lib,
pkgs,
...
}: {
home.file.".oh-my-zsh/custom/themes/agnoster.zsh-theme".source =
../config/agnoster.zsh-theme;
}:
{
home.file.".oh-my-zsh/custom/themes/agnoster.zsh-theme".source = ../config/agnoster.zsh-theme;
home.activation.ensureOhMyZshCache = lib.hm.dag.entryAfter ["writeBoundary"] ''
home.activation.ensureOhMyZshCache = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir -p "${config.xdg.cacheHome}/oh-my-zsh"
'';
home.packages = [pkgs.oh-my-zsh];
home.packages = [ pkgs.oh-my-zsh ];
programs.zsh = {
enable = true;
@ -22,42 +22,40 @@
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases =
{
co = "codex --dangerously-bypass-approvals-and-sandbox";
ca = "cursor-agent";
cc = "claude";
ch = "claude-handoff";
cl = "clear";
gc = "git commit";
gd = "git diff";
gk = "git checkout";
gp = "git push";
gpo = "git pull origin";
gs = "git status";
ld = "lumen diff";
lg = "lazygit";
nim = "nvim .";
shellAliases = {
co = "codex --dangerously-bypass-approvals-and-sandbox";
ca = "cursor-agent";
cc = "claude";
ch = "claude-handoff";
cl = "clear";
gc = "git commit";
gd = "git diff";
gk = "git checkout";
gp = "git push";
gpo = "git pull origin";
gs = "git status";
ld = "lumen diff";
lg = "lazygit";
nim = "nvim .";
}
// lib.optionalAttrs pkgs.stdenv.isDarwin {
tailscale = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
};
envExtra =
''
if [[ -f "$HOME/.cargo/env" ]]; then
. "$HOME/.cargo/env"
fi
export NODE_NO_WARNINGS=1
''
+ lib.optionalString pkgs.stdenv.isDarwin ''
# Ghostty shell integration expects a resource directory; the Nix app
# bundle lives in the store instead of /Applications.
export GHOSTTY_RESOURCES_DIR="${pkgs.ghostty-bin}/Applications/Ghostty.app/Contents/Resources/ghostty"
''
+ ''
export MANPAGER="nvim +Man!"
'';
envExtra = ''
if [[ -f "$HOME/.cargo/env" ]]; then
. "$HOME/.cargo/env"
fi
export NODE_NO_WARNINGS=1
''
+ lib.optionalString pkgs.stdenv.isDarwin ''
# Ghostty shell integration expects a resource directory; the Nix app
# bundle lives in the store instead of /Applications.
export GHOSTTY_RESOURCES_DIR="${pkgs.ghostty-bin}/Applications/Ghostty.app/Contents/Resources/ghostty"
''
+ ''
export MANPAGER="nvim +Man!"
'';
initContent = lib.mkMerge [
(lib.mkOrder 550 ''
@ -88,9 +86,7 @@
export BUN_INSTALL="$HOME/.bun"
export PNPM_HOME="${
if pkgs.stdenv.isDarwin
then "$HOME/Library/pnpm"
else "${config.xdg.dataHome}/pnpm"
if pkgs.stdenv.isDarwin then "$HOME/Library/pnpm" else "${config.xdg.dataHome}/pnpm"
}"
bindkey -v
typeset -U path PATH
@ -107,9 +103,9 @@
"/run/current-system/sw/bin"
"/nix/var/nix/profiles/default/bin"
${lib.optionalString pkgs.stdenv.isDarwin ''
"/opt/homebrew/bin"
"/opt/homebrew/sbin"
''}
"/opt/homebrew/bin"
"/opt/homebrew/sbin"
''}
$path
)