Updates for work #3

Merged
lytedev merged 3 commits from lytedev-divvy/nix:main into main 2024-02-09 10:33:06 -06:00
Showing only changes of commit a79d4f2426 - Show all commits

View file

@ -1,4 +1,9 @@
{ pkgs, lib, ... }: {
{ pkgs, lib, ... }:
let
email = "daniel@lyte.dev";
name = "Daniel Flanagan";
in
{
# TODO: email access?
# accounts.email.accounts = {
# google = {
@ -6,22 +11,15 @@
# };
# };
home.file."nix.conf" = {
target = ".config/nix/nix.conf";
text = ''
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=
'';
};
home = {
username = lib.mkDefault "daniel";
homeDirectory = lib.mkDefault "/home/daniel/.home";
stateVersion = "23.05";
home.username = lib.mkDefault "daniel";
home.homeDirectory = lib.mkDefault "/home/daniel/.home";
home.stateVersion = "23.05";
home.packages = [
pkgs.rtx
# I use this for managing the following programs' versions instead of nix:
packages = [
# I use rtx for managing the following programs' versions instead of nix:
# kubectl, aws
pkgs.rtx
# text editor
pkgs.helix
@ -31,18 +29,342 @@
pkgs.nil
pkgs.nixpkgs-fmt
pkgs.gnupg
# 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 ]; })
];
programs.password-store = {
file = {
".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;
package = (pkgs.pass.withExtensions (exts: [ exts.pass-otp ]));
};
programs.zellij = {
git = {
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
enable = false;
enableFishIntegration = true;
@ -51,7 +373,7 @@
};
};
programs.broot = {
broot = {
enable = true;
enableFishIntegration = true;
settings = {
@ -155,14 +477,14 @@
};
};
programs.home-manager.enable = true;
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
programs.fish = {
direnv = {
enable = true;
# load long scripts from files for better editing experience
nix-direnv.enable = true;
};
fish = {
enable = true;
# I load long scripts from files for a better editing experience
shellInit = builtins.readFile ../fish/shellInit.fish;
interactiveShellInit = builtins.readFile ../fish/interactiveShellInit.fish;
loginShellInit = "";
@ -222,8 +544,6 @@
lC = "lc --reverse";
lD = "la --only-dirs";
"cd.." = "d ..";
"cdd" = "d $DOTFILES_PATH";
"cde" = "d $XDG_CONFIG_HOME/lytedev-env";
"cdc" = "d $XDG_CONFIG_HOME";
"cdn" = "d $NOTES_PATH";
"cdl" = "d $XDG_DOWNLOAD_DIR";
@ -237,6 +557,7 @@
"........" = "d ../../../../../../..";
"........." = "d ../../../../../../../..";
cat = "bat";
p = "ping";
dc = "docker compose";
k = "kubectl";
kg = "kubectl get";
@ -246,17 +567,20 @@
};
};
programs.exa.enable = true;
exa = {
enable = true;
};
programs.skim = {
skim = {
enable = true;
enableFishIntegration = true;
};
programs.nix-index = {
nix-index = {
enable = true;
enableFishIntegration = true;
};
};
# wayland.windowManager.sway = {
# enable = true;
@ -264,3 +588,6 @@
# 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?
}