This commit is contained in:
Daniel Flanagan 2023-09-11 10:29:12 -05:00
parent ac964dcee9
commit 9b0035c59a
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
4 changed files with 616 additions and 272 deletions

View file

@ -1,4 +1,8 @@
{ pkgs, lib, ... }: {
{pkgs, lib, ...}: let
email = "daniel@lyte.dev";
name = "Daniel Flanagan";
in
{
# TODO: email access?
# accounts.email.accounts = {
# google = {
@ -6,25 +10,357 @@
# };
# };
home.username = "daniel";
home.homeDirectory = lib.mkDefault "/home/daniel/.home";
home.stateVersion = "23.05";
home = {
username = "daniel";
homeDirectory = lib.mkDefault "/home/daniel/.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
# 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()
)
'';
};
};
pointerCursor = {
name = "Catppuccin-Mocha-Sapphire-Cursors";
package = pkgs.catppuccin-cursors.mochaSapphire;
size = 64; # TODO: this doesn't seem to work -- at least in Sway
};
};
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;
@ -33,7 +369,7 @@
};
};
programs.broot = {
broot = {
enable = true;
enableFishIntegration = true;
settings = {
@ -137,12 +473,16 @@
};
};
programs.home-manager.enable = true;
home-manager = {
enable = true;
};
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
direnv = {
enable = true;
nix-direnv.enable = true;
};
programs.fish = {
fish = {
enable = true;
# I load long scripts from files for a better editing experience
shellInit = builtins.readFile ./fish/shellInit.fish;
@ -219,6 +559,7 @@
"........" = "d ../../../../../../..";
"........." = "d ../../../../../../../..";
cat = "bat";
p = "ping";
dc = "docker compose";
k = "kubectl";
kg = "kubectl get";
@ -228,25 +569,21 @@
};
};
programs.exa.enable = true;
exa = {
enable = true;
};
programs.skim = {
skim = {
enable = true;
enableFishIntegration = true;
};
programs.nix-index = {
nix-index = {
enable = true;
enableFishIntegration = true;
};
home.pointerCursor = {
name = "Catppuccin-Mocha-Sapphire-Cursors";
package = pkgs.catppuccin-cursors.mochaSapphire;
size = 64; # TODO: this doesn't seem to work -- at least in Sway
};
programs.firefox = {
firefox = {
# TODO: enable dark theme by default
enable = true;
@ -291,6 +628,7 @@
};
};
};
# wayland.windowManager.sway = {
# enable = true;
@ -298,3 +636,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?
}

View file

@ -1,6 +1,7 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
# nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-channels/nixos-unstable";
api-lyte-dev.url = "git+ssh://gitea@git.lyte.dev/lytedev/api.lyte.dev.git";
home-manager.url = "github:nix-community/home-manager/release-23.05";
disko.url = "github:nix-community/disko/master";

View file

@ -1,17 +1,15 @@
inputs:
inputs @ { nixpkgs, home-manager, ... }:
let
system = "x86_64-linux";
pkgs = inputs.nixpkgs.legacyPackages.${system};
in
{
overlay = final: prev: {
helix = prev.helix // inputs.helix.packages.${system}.helix;
rtx = prev.rtx // inputs.rtx.packages.${system}.rtx;
};
pkgs = import nixpkgs { inherit system; overlays = [ overlay ]; };
in {
# TODO: per arch?
daniel = inputs.home-manager.lib.homeManagerConfiguration {
daniel = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
(import
./daniel.nix
pkgs)
];
modules = [ import ./daniel.nix pkgs ];
};
}

View file

@ -64,6 +64,10 @@ in
plugins = with pkgs.xfce; [ thunar-archive-plugin thunar-volman ];
};
services.gvfs = {
enable = true;
};
environment.systemPackages = with pkgs; [
brightnessctl
feh