mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-15 05:02:10 +00:00
fix formatting
This commit is contained in:
parent
5747c7a6fd
commit
458778c860
5 changed files with 80 additions and 65 deletions
|
|
@ -3,9 +3,11 @@
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
customScripts = import ../scripts {inherit config lib pkgs;};
|
let
|
||||||
in {
|
customScripts = import ../scripts { inherit config lib pkgs; };
|
||||||
|
in
|
||||||
|
{
|
||||||
home.packages = builtins.attrValues customScripts.nettyPackages;
|
home.packages = builtins.attrValues customScripts.nettyPackages;
|
||||||
|
|
||||||
programs.zsh.initContent = lib.mkAfter ''
|
programs.zsh.initContent = lib.mkAfter ''
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{...}: {
|
{ ... }:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./common.nix
|
./common.nix
|
||||||
./netty-worktree.nix
|
./netty-worktree.nix
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,16 @@
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
customScripts = import ../scripts {inherit config lib pkgs;};
|
let
|
||||||
in {
|
customScripts = import ../scripts { inherit config lib pkgs; };
|
||||||
|
in
|
||||||
|
{
|
||||||
home.packages =
|
home.packages =
|
||||||
builtins.attrValues customScripts.commonPackages
|
builtins.attrValues customScripts.commonPackages
|
||||||
++ lib.optionals pkgs.stdenv.isDarwin (builtins.attrValues customScripts.darwinPackages);
|
++ lib.optionals pkgs.stdenv.isDarwin (builtins.attrValues customScripts.darwinPackages);
|
||||||
|
|
||||||
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}"
|
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
|
if [[ -f "${customScripts.theme.paths.stateFile}" ]]; then
|
||||||
|
|
|
||||||
85
home/zsh.nix
85
home/zsh.nix
|
|
@ -3,14 +3,15 @@
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
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"
|
mkdir -p "${config.xdg.cacheHome}/oh-my-zsh"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
home.packages = [pkgs.oh-my-zsh];
|
home.packages = [ pkgs.oh-my-zsh ];
|
||||||
|
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -21,42 +22,40 @@
|
||||||
autosuggestion.enable = true;
|
autosuggestion.enable = true;
|
||||||
syntaxHighlighting.enable = true;
|
syntaxHighlighting.enable = true;
|
||||||
|
|
||||||
shellAliases =
|
shellAliases = {
|
||||||
{
|
co = "codex --dangerously-bypass-approvals-and-sandbox";
|
||||||
co = "codex --dangerously-bypass-approvals-and-sandbox";
|
ca = "cursor-agent";
|
||||||
ca = "cursor-agent";
|
cc = "claude";
|
||||||
cc = "claude";
|
ch = "claude-handoff";
|
||||||
ch = "claude-handoff";
|
cl = "clear";
|
||||||
cl = "clear";
|
gc = "git commit";
|
||||||
gc = "git commit";
|
gd = "git diff";
|
||||||
gd = "git diff";
|
gk = "git checkout";
|
||||||
gk = "git checkout";
|
gp = "git push";
|
||||||
gp = "git push";
|
gpo = "git pull origin";
|
||||||
gpo = "git pull origin";
|
gs = "git status";
|
||||||
gs = "git status";
|
ld = "lumen diff";
|
||||||
ld = "lumen diff";
|
lg = "lazygit";
|
||||||
lg = "lazygit";
|
nim = "nvim .";
|
||||||
nim = "nvim .";
|
}
|
||||||
}
|
// lib.optionalAttrs pkgs.stdenv.isDarwin {
|
||||||
// lib.optionalAttrs pkgs.stdenv.isDarwin {
|
tailscale = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
|
||||||
tailscale = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
|
};
|
||||||
};
|
|
||||||
|
|
||||||
envExtra =
|
envExtra = ''
|
||||||
''
|
if [[ -f "$HOME/.cargo/env" ]]; then
|
||||||
if [[ -f "$HOME/.cargo/env" ]]; then
|
. "$HOME/.cargo/env"
|
||||||
. "$HOME/.cargo/env"
|
fi
|
||||||
fi
|
export NODE_NO_WARNINGS=1
|
||||||
export NODE_NO_WARNINGS=1
|
''
|
||||||
''
|
+ lib.optionalString pkgs.stdenv.isDarwin ''
|
||||||
+ lib.optionalString pkgs.stdenv.isDarwin ''
|
# Ghostty shell integration expects a resource directory; the Nix app
|
||||||
# Ghostty shell integration expects a resource directory; the Nix app
|
# bundle lives in the store instead of /Applications.
|
||||||
# bundle lives in the store instead of /Applications.
|
export GHOSTTY_RESOURCES_DIR="${pkgs.ghostty-bin}/Applications/Ghostty.app/Contents/Resources/ghostty"
|
||||||
export GHOSTTY_RESOURCES_DIR="${pkgs.ghostty-bin}/Applications/Ghostty.app/Contents/Resources/ghostty"
|
''
|
||||||
''
|
+ ''
|
||||||
+ ''
|
export MANPAGER="nvim +Man!"
|
||||||
export MANPAGER="nvim +Man!"
|
'';
|
||||||
'';
|
|
||||||
|
|
||||||
initContent = lib.mkMerge [
|
initContent = lib.mkMerge [
|
||||||
(lib.mkOrder 550 ''
|
(lib.mkOrder 550 ''
|
||||||
|
|
@ -87,9 +86,7 @@
|
||||||
|
|
||||||
export BUN_INSTALL="$HOME/.bun"
|
export BUN_INSTALL="$HOME/.bun"
|
||||||
export PNPM_HOME="${
|
export PNPM_HOME="${
|
||||||
if pkgs.stdenv.isDarwin
|
if pkgs.stdenv.isDarwin then "$HOME/Library/pnpm" else "${config.xdg.dataHome}/pnpm"
|
||||||
then "$HOME/Library/pnpm"
|
|
||||||
else "${config.xdg.dataHome}/pnpm"
|
|
||||||
}"
|
}"
|
||||||
bindkey -v
|
bindkey -v
|
||||||
typeset -U path PATH
|
typeset -U path PATH
|
||||||
|
|
@ -106,9 +103,9 @@
|
||||||
"/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 ''
|
${lib.optionalString pkgs.stdenv.isDarwin ''
|
||||||
"/opt/homebrew/bin"
|
"/opt/homebrew/bin"
|
||||||
"/opt/homebrew/sbin"
|
"/opt/homebrew/sbin"
|
||||||
''}
|
''}
|
||||||
$path
|
$path
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,20 +2,22 @@
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
}: let
|
}:
|
||||||
theme = import ../lib/theme.nix {inherit config;};
|
let
|
||||||
|
theme = import ../lib/theme.nix { inherit config; };
|
||||||
|
|
||||||
tmuxConfigs = {
|
tmuxConfigs = {
|
||||||
dark = pkgs.writeText "tmux-theme-dark.conf" (theme.renderTmux "dark");
|
dark = pkgs.writeText "tmux-theme-dark.conf" (theme.renderTmux "dark");
|
||||||
light = pkgs.writeText "tmux-theme-light.conf" (theme.renderTmux "light");
|
light = pkgs.writeText "tmux-theme-light.conf" (theme.renderTmux "light");
|
||||||
};
|
};
|
||||||
|
|
||||||
mkScript = {
|
mkScript =
|
||||||
file,
|
{
|
||||||
name,
|
file,
|
||||||
runtimeInputs ? [],
|
name,
|
||||||
replacements ? {},
|
runtimeInputs ? [ ],
|
||||||
}:
|
replacements ? { },
|
||||||
|
}:
|
||||||
pkgs.writeShellApplication {
|
pkgs.writeShellApplication {
|
||||||
inherit name runtimeInputs;
|
inherit name runtimeInputs;
|
||||||
text = lib.replaceStrings (builtins.attrNames replacements) (builtins.attrValues replacements) (
|
text = lib.replaceStrings (builtins.attrNames replacements) (builtins.attrValues replacements) (
|
||||||
|
|
@ -27,7 +29,7 @@
|
||||||
ga = mkScript {
|
ga = mkScript {
|
||||||
name = "ga";
|
name = "ga";
|
||||||
file = ./ga.sh;
|
file = ./ga.sh;
|
||||||
runtimeInputs = with pkgs; [git];
|
runtimeInputs = with pkgs; [ git ];
|
||||||
};
|
};
|
||||||
|
|
||||||
ghpr = mkScript {
|
ghpr = mkScript {
|
||||||
|
|
@ -71,7 +73,7 @@
|
||||||
ni = mkScript {
|
ni = mkScript {
|
||||||
name = "ni";
|
name = "ni";
|
||||||
file = ./ni.sh;
|
file = ./ni.sh;
|
||||||
runtimeInputs = with pkgs; [nix];
|
runtimeInputs = with pkgs; [ nix ];
|
||||||
};
|
};
|
||||||
|
|
||||||
theme = mkScript {
|
theme = mkScript {
|
||||||
|
|
@ -115,7 +117,11 @@
|
||||||
wt = mkScript {
|
wt = mkScript {
|
||||||
name = "wt";
|
name = "wt";
|
||||||
file = ./wt.sh;
|
file = ./wt.sh;
|
||||||
runtimeInputs = with pkgs; [coreutils git gnused];
|
runtimeInputs = with pkgs; [
|
||||||
|
coreutils
|
||||||
|
git
|
||||||
|
gnused
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
wt-create = mkScript {
|
wt-create = mkScript {
|
||||||
|
|
@ -123,8 +129,15 @@
|
||||||
file = ./wt-create.sh;
|
file = ./wt-create.sh;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
inherit commonPackages darwinPackages nettyPackages theme tmuxConfigs;
|
{
|
||||||
|
inherit
|
||||||
|
commonPackages
|
||||||
|
darwinPackages
|
||||||
|
nettyPackages
|
||||||
|
theme
|
||||||
|
tmuxConfigs
|
||||||
|
;
|
||||||
|
|
||||||
packages = commonPackages;
|
packages = commonPackages;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue