This commit is contained in:
Daniel Flanagan 2023-09-18 17:13:22 -05:00
parent d72f1d31c3
commit 8f431a09b0
2 changed files with 223 additions and 550 deletions

View file

@ -72,6 +72,6 @@ if has_command rtx
rtx activate fish | source rtx activate fish | source
end end
for dir in $HOME/.cargo/bin for dir in $HOME/.cargo/bin /opt/homebrew/bin
fish_add_path $dir fish_add_path $dir
end end

View file

@ -1,9 +1,4 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }: {
let
email = "daniel@lyte.dev";
name = "Daniel Flanagan";
in
{
# TODO: email access? # TODO: email access?
# accounts.email.accounts = { # accounts.email.accounts = {
# google = { # google = {
@ -11,15 +6,22 @@ in
# }; # };
# }; # };
home = { home.file."nix.conf" = {
username = lib.mkDefault "daniel"; target = ".config/nix/nix.conf";
homeDirectory = lib.mkDefault "/home/daniel/.home"; text = ''
stateVersion = "23.05"; substituters = https://nix.h.lyte.dev https://cache.nixos.org
trusted-public-keys = h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
'';
};
packages = [ home.username = lib.mkDefault "daniel";
# I use rtx for managing the following programs' versions instead of nix: home.homeDirectory = lib.mkDefault "/home/daniel/.home";
# kubectl, aws home.stateVersion = "23.05";
home.packages = [
pkgs.rtx pkgs.rtx
# I use this for managing the following programs' versions instead of nix:
# kubectl, aws
# text editor # text editor
pkgs.helix pkgs.helix
@ -29,342 +31,18 @@ in
pkgs.nil pkgs.nil
pkgs.nixpkgs-fmt pkgs.nixpkgs-fmt
pkgs.gnupg
# TODO: os-specific scripts? macOS versus Linux (arch or nixos? do I need to distinguish at that point?) # TODO: os-specific scripts? macOS versus Linux (arch or nixos? do I need to distinguish at that point?)
(pkgs.buildEnv { name = "my-scripts"; paths = [ ../scripts ]; }) (pkgs.buildEnv { name = "my-scripts"; paths = [ ../scripts ]; })
]; ];
file = { programs.password-store = {
".iex.exs" = {
enable = true;
text = ''
Application.put_env(:elixir, :ansi_enabled, true)
# PROTIP: to break, `#iex:break`
IEx.configure(
colors: [enabled: true],
inspect: [
pretty: true,
printable_limit: :infinity,
limit: :infinity
],
default_prompt:
[
# ANSI CHA, move cursor to column 1
"\e[G",
:magenta,
# IEx prompt variable
"%prefix",
"#",
# IEx prompt variable
"%counter",
# plain string
">",
:reset
]
|> IO.ANSI.format()
|> IO.chardata_to_string()
)
'';
};
};
};
programs = {
password-store = {
enable = true; enable = true;
package = (pkgs.pass.withExtensions (exts: [ exts.pass-otp ])); package = (pkgs.pass.withExtensions (exts: [ exts.pass-otp ]));
}; };
git = { programs.zellij = {
enable = true;
userEmail = email;
userName = name;
delta = {
enable = true;
options = { };
};
lfs = {
enable = true;
};
signing = {
signByDefault = true;
key = "daniel@lyte.dev";
};
extraConfig = {
push = {
autoSetupRemote = true;
};
branch = {
autoSeupMerge = true;
};
sendemail = {
smtpserver = "smtp.mailgun.org";
smtpuser = "daniel@lyte.dev";
smtrpencryption = "tls";
smtpserverport = 587;
};
url = {
"git@git.hq.bill.com:" = {
insteadOf = "https://git.hq.bill.com";
};
};
aliases = {
a = "add";
A = "add - A";
ac = "commit - a";
b = "rev-parse - -symbolic-full-name HEAD";
c = "commit";
cm = "commit - m";
cnv = "commit - -no-verify";
co = "checkoutd";
d = "diff";
ds = "diff - -staged";
dt = "difftool ";
f = "fetch";
l = "log - -graph - -abbrev-commit - -decorate - -oneline - -all";
plainlog = " log - -pretty=format:'%h %ad%x09%an%x09%s' --date=short --decorate";
ls = "ls-files";
mm = "merge master";
p = "push";
pf = "push --force-with-lease";
pl = "pull";
rim = "rebase -i master";
s = "status";
sur = "submodule update --remote";
};
};
};
gitui = {
enable = true;
};
helix = {
enable = true;
package = pkgs.helix;
languages = {
language-server = {
lexical = {
command = "lexical";
args = [ "start" ];
};
};
language = [
{
name = "elixir";
language-servers = [ "elixir-ls" "lexical" ];
auto-format = true;
}
{
name = "html";
auto-format = false;
}
{
name = "nix";
auto-format = true;
formatter = {
command = "nixpkgs-fmt";
args = [ ];
};
}
{
name = "fish";
auto-format = true;
indent = {
tab-width = 2;
unit = "\t";
};
}
# TODO: deno:
#[[language]]
#name = "javascript"
#scope = "source.js"
#injection-regex = "^(js|javascript)$"
#file-types = [ "js", "jsx", "mjs" ]
#shebangs = [ "deno", "node" ]
#roots = [ "deno.jsonc", "deno.json", "package.json", "tsconfig.json" ]
#comment-token = "//"
# config = { enable = true, lint = true, unstable = true }
# language-server = { command = "typescript-language-server", args = ["--stdio"], language-id = "javascript" }
#indent = {
#tab-width = 2, unit = "\t" }
#auto-format = true
# [[language]]
# name = "jsx"
# scope = "source.jsx"
# injection-regex = "jsx"
# file-types = ["jsx"]
# shebangs = ["deno", "node"]
# roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"]
# comment-token = "//"
# config = { enable = true, lint = true, unstable = true }
# language-server = { command = "deno", args = ["lsp"], language-id = "javascriptreact" }
# indent = { tab-width = 2, unit = " " }
# grammar = "javascript"
# auto-format = true
# [[language]]
# name = "typescript"
# scope = "source.ts"
# injection-regex = "^(ts|typescript)$"
# file-types = ["ts"]
# shebangs = ["deno", "node"]
# roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"]
# config = { enable = true, lint = true, unstable = true }
# language-server = { command = "deno", args = ["lsp"], language-id = "typescript" }
# indent = { tab-width = 2, unit = " " }
# auto-format = true
# [[language]]
# name = "tsx"
# scope = "source.tsx"
# injection-regex = "^(tsx)$" # |typescript
# file-types = ["tsx"]
# shebangs = ["deno", "node"]
# roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"]
# config = { enable = true, lint = true, unstable = true }
# language-server = { command = "deno", args = ["lsp"], language-id = "typescriptreact" }
# indent = { tab-width = 2, unit = " " }
# auto-format = true
# [[language]]
# name = "jsonc"
# scope = "source.jsonc"
# injection-regex = "^(jsonc)$"
# file-types = ["jsonc"]
# shebangs = ["deno", "node"]
# roots = ["deno.jsonc", "deno.json", "package.json", "tsconfig.json"]
# config = { enable = true, lint = true, unstable = true }
# language-server = { command = "deno", args = ["lsp"], language-id = "jsonc" }
# indent = { tab-width = 2, unit = " " }
# auto-format = true
];
};
settings = {
theme = "custom";
editor = {
soft-wrap.enable = true;
auto-pairs = false;
auto-save = false;
completion-trigger-len = 1;
color-modes = false;
bufferline = "multiple";
scrolloff = 8;
rulers = [ 80 120 ];
cursorline = true;
cursor-shape = {
normal = "block";
insert = "bar";
select = "underline";
};
file-picker.hidden = false;
indent-guides = {
render = true;
character = "";
};
lsp = {
display-messages = true;
display-inlay-hints = true;
};
statusline = {
left = [ "mode" "spinner" "selections" "primary-selection-length" "position" "position-percentage" "diagnostics" "workspace-diagnostics" ];
center = [ "file-name" ];
right = [ "version-control" "total-line-numbers" "file-encoding" ];
};
};
keys = {
insert = {
j = { k = "normal_mode"; j = "normal_mode"; K = "normal_mode"; J = "normal_mode"; };
};
normal = {
D = "kill_to_line_end";
"^" = "goto_line_start";
"C-k" = "jump_view_up";
"C-j" = "jump_view_down";
"C-h" = "jump_view_left";
"C-l" = "jump_view_right";
"C-q" = ":quit-all!";
"L" = "repeat_last_motion";
space = {
q = ":reflow 80";
Q = ":reflow 120";
v = ":run-shell-command fish -c 'env > /tmp/env'";
C = ":bc!";
h = ":toggle lsp.display-inlay-hints";
# O = ["select_textobject_inner WORD", ":pipe-to xargs xdg-open"];
};
};
select = {
space = { q = ":reflow 80"; Q = ":reflow 120"; };
"L" = "repeat_last_motion";
};
};
};
themes = {
custom = {
"inherits" = "catppuccin_mocha";
"ui.background" = "default";
# "ui.cursorline.primary" = { bg = "default" }
# "ui.cursorline.secondary" = { bg = "default" }
# "ui.cursorcolumn.primary" = { bg = "default" }
# "ui.cursorcolumn.secondary" = { bg = "default" }
# "ui.virtual.ruler" = { bg = "default" }
"ui.bufferline.active" = {
fg = "sapphire";
bg = "base";
underline = {
color = "sapphire";
style = "";
};
};
};
};
};
bat = {
enable = true;
config = {
theme = "Catppuccin-mocha";
};
themes = {
"Catppuccin-mocha" = builtins.readFile (pkgs.fetchFromGitHub
{
owner = "catppuccin";
repo = "bat";
rev = "477622171ec0529505b0ca3cada68fc9433648c6";
sha256 = "6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
} + "/Catppuccin-mocha.tmTheme");
};
};
zellij = {
# TODO: enable after port config # TODO: enable after port config
enable = false; enable = false;
enableFishIntegration = true; enableFishIntegration = true;
@ -373,7 +51,7 @@ in
}; };
}; };
broot = { programs.broot = {
enable = true; enable = true;
enableFishIntegration = true; enableFishIntegration = true;
settings = { settings = {
@ -477,14 +155,14 @@ in
}; };
}; };
direnv = { programs.home-manager.enable = true;
enable = true;
nix-direnv.enable = true;
};
fish = { programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
programs.fish = {
enable = true; enable = true;
# I load long scripts from files for a better editing experience # load long scripts from files for better editing experience
shellInit = builtins.readFile ../fish/shellInit.fish; shellInit = builtins.readFile ../fish/shellInit.fish;
interactiveShellInit = builtins.readFile ../fish/interactiveShellInit.fish; interactiveShellInit = builtins.readFile ../fish/interactiveShellInit.fish;
loginShellInit = ""; loginShellInit = "";
@ -544,6 +222,8 @@ in
lC = "lc --reverse"; lC = "lc --reverse";
lD = "la --only-dirs"; lD = "la --only-dirs";
"cd.." = "d .."; "cd.." = "d ..";
"cdd" = "d $DOTFILES_PATH";
"cde" = "d $XDG_CONFIG_HOME/lytedev-env";
"cdc" = "d $XDG_CONFIG_HOME"; "cdc" = "d $XDG_CONFIG_HOME";
"cdn" = "d $NOTES_PATH"; "cdn" = "d $NOTES_PATH";
"cdl" = "d $XDG_DOWNLOAD_DIR"; "cdl" = "d $XDG_DOWNLOAD_DIR";
@ -557,7 +237,6 @@ in
"........" = "d ../../../../../../.."; "........" = "d ../../../../../../..";
"........." = "d ../../../../../../../.."; "........." = "d ../../../../../../../..";
cat = "bat"; cat = "bat";
p = "ping";
dc = "docker compose"; dc = "docker compose";
k = "kubectl"; k = "kubectl";
kg = "kubectl get"; kg = "kubectl get";
@ -567,20 +246,17 @@ in
}; };
}; };
exa = { programs.exa.enable = true;
enable = true;
};
skim = { programs.skim = {
enable = true; enable = true;
enableFishIntegration = true; enableFishIntegration = true;
}; };
nix-index = { programs.nix-index = {
enable = true; enable = true;
enableFishIntegration = true; enableFishIntegration = true;
}; };
};
# wayland.windowManager.sway = { # wayland.windowManager.sway = {
# enable = true; # enable = true;
@ -588,6 +264,3 @@ in
# maybe we can share somehow so things for nix-y systems and non-nix-y systems alike # maybe we can share somehow so things for nix-y systems and non-nix-y systems alike
# am I going to _have_ non-nix systems anymore? # am I going to _have_ non-nix systems anymore?
} }