add core configuration

This commit is contained in:
Chance 2025-03-29 21:03:07 -04:00 committed by lily
parent 74c78e1c68
commit f40517cff1
Signed by: lily
GPG key ID: 601F3263FBCBC4B9
94 changed files with 2816 additions and 959 deletions

View file

@ -0,0 +1,27 @@
{
config,
lib,
...
}: let
cfg = config.lily.chromium;
in {
options.lily.chromium = {
enable = lib.mkEnableOption "activate chromium";
};
config = lib.mkIf cfg.enable {
programs.chromium = {
enable = true;
extensions = [
{id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";} # ublock origin
{id = "pkehgijcmpdhfbdbbnkijodmdjhbjlgp";} # privacy badger
{id = "ldpochfccmkkmhdbclfhpagapcfdljkj";} # decentraleyes
{id = "mnjggcdmjocbbbhaepdhchncahnbgone";} # sponsor block
{id = "gebbhagfogifgggkldgodflihgfeippi";} # return youtube dislike (just cuz)
];
commandLineArgs = [
"--enable-features=UseOzonePlatform"
"--ozone-platform=wayland"
];
};
};
}

View file

@ -0,0 +1,37 @@
{
config,
lib,
...
}: let
cfg = config.lily.ghostty;
in {
options.lily.ghostty = {
enable = lib.mkEnableOption "activate ghostty";
};
config = lib.mkIf cfg.enable {
home.file.".config/ghostty/shaders" = {
source = ./shaders;
recursive = true;
};
programs.ghostty = {
enable = true;
settings = {
background-blur-radius = 0;
#theme = "dark:catppuccin-mocha,light:catppuccin-latte";
window-theme = "dark";
background-opacity = 0.75;
minimum-contrast = 1.1;
window-padding-x = 5;
window-padding-y = 5;
gtk-adwaita = false;
gtk-titlebar = false;
# custom-shader = "shaders/crt.glsl";
# custom-shader = "shaders/glow.glsl";
confirm-close-surface = false;
custom-shader-animation = true;
};
};
};
}

View file

@ -0,0 +1,153 @@
// First it does a "chromatic aberration" by splitting the rgb signals by a product of sin functions
// over time, then it does a glow effect in a perceptual color space
// Based on kalgynirae's Ghostty passable glow shader and NickWest's Chromatic Aberration shader demo
// Passable glow: https://github.com/kalgynirae/dotfiles/blob/main/ghostty/glow.glsl
// "Chromatic Aberration": https://www.shadertoy.com/view/Mds3zn
// sRGB linear -> nonlinear transform from https://bottosson.github.io/posts/colorwrong/
float f(float x) {
if (x >= 0.0031308) {
return 1.055 * pow(x, 1.0 / 2.4) - 0.055;
} else {
return 12.92 * x;
}
}
float f_inv(float x) {
if (x >= 0.04045) {
return pow((x + 0.055) / 1.055, 2.4);
} else {
return x / 12.92;
}
}
// Oklab <-> linear sRGB conversions from https://bottosson.github.io/posts/oklab/
vec4 toOklab(vec4 rgb) {
vec3 c = vec3(f_inv(rgb.r), f_inv(rgb.g), f_inv(rgb.b));
float l = 0.4122214708 * c.r + 0.5363325363 * c.g + 0.0514459929 * c.b;
float m = 0.2119034982 * c.r + 0.6806995451 * c.g + 0.1073969566 * c.b;
float s = 0.0883024619 * c.r + 0.2817188376 * c.g + 0.6299787005 * c.b;
float l_ = pow(l, 1.0 / 3.0);
float m_ = pow(m, 1.0 / 3.0);
float s_ = pow(s, 1.0 / 3.0);
return vec4(
0.2104542553 * l_ + 0.7936177850 * m_ - 0.0040720468 * s_,
1.9779984951 * l_ - 2.4285922050 * m_ + 0.4505937099 * s_,
0.0259040371 * l_ + 0.7827717662 * m_ - 0.8086757660 * s_,
rgb.a
);
}
vec4 toRgb(vec4 oklab) {
vec3 c = oklab.rgb;
float l_ = c.r + 0.3963377774 * c.g + 0.2158037573 * c.b;
float m_ = c.r - 0.1055613458 * c.g - 0.0638541728 * c.b;
float s_ = c.r - 0.0894841775 * c.g - 1.2914855480 * c.b;
float l = l_ * l_ * l_;
float m = m_ * m_ * m_;
float s = s_ * s_ * s_;
vec3 linear_srgb = vec3(
4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
-0.0041960863 * l - 0.7034186147 * m + 1.7076147010 * s
);
return vec4(
clamp(f(linear_srgb.r), 0.0, 1.0),
clamp(f(linear_srgb.g), 0.0, 1.0),
clamp(f(linear_srgb.b), 0.0, 1.0),
oklab.a
);
}
// Bloom samples from https://gist.github.com/qwerasd205/c3da6c610c8ffe17d6d2d3cc7068f17f
const vec3[24] samples = {
vec3(0.1693761725038636, 0.9855514761735895, 1),
vec3(-1.333070830962943, 0.4721463328627773, 0.7071067811865475),
vec3(-0.8464394909806497, -1.51113870578065, 0.5773502691896258),
vec3(1.554155680728463, -1.2588090085709776, 0.5),
vec3(1.681364377589461, 1.4741145918052656, 0.4472135954999579),
vec3(-1.2795157692199817, 2.088741103228784, 0.4082482904638631),
vec3(-2.4575847530631187, -0.9799373355024756, 0.3779644730092272),
vec3(0.5874641440200847, -2.7667464429345077, 0.35355339059327373),
vec3(2.997715703369726, 0.11704939884745152, 0.3333333333333333),
vec3(0.41360842451688395, 3.1351121305574803, 0.31622776601683794),
vec3(-3.167149933769243, 0.9844599011770256, 0.30151134457776363),
vec3(-1.5736713846521535, -3.0860263079123245, 0.2886751345948129),
vec3(2.888202648340422, -2.1583061557896213, 0.2773500981126146),
vec3(2.7150778983300325, 2.5745586041105715, 0.2672612419124244),
vec3(-2.1504069972377464, 3.2211410627650165, 0.2581988897471611),
vec3(-3.6548858794907493, -1.6253643308191343, 0.25),
vec3(1.0130775986052671, -3.9967078676335834, 0.24253562503633297),
vec3(4.229723673607257, 0.33081361055181563, 0.23570226039551587),
vec3(0.40107790291173834, 4.340407413572593, 0.22941573387056174),
vec3(-4.319124570236028, 1.159811599693438, 0.22360679774997896),
vec3(-1.9209044802827355, -4.160543952132907, 0.2182178902359924),
vec3(3.8639122286635708, -2.6589814382925123, 0.21320071635561041),
vec3(3.3486228404946234, 3.4331800232609, 0.20851441405707477),
vec3(-2.8769733643574344, 3.9652268864187157, 0.20412414523193154)
};
float offsetFunction(float iTime) {
float amount = 1.0;
const float periods[4] = {6.0, 16.0, 19.0, 27.0};
for (int i = 0; i < 4; i++) {
amount *= 1.0 + 0.5 * sin(iTime*periods[i]);
}
//return amount;
return amount * periods[3];
}
const float DIM_CUTOFF = 0.35;
const float BRIGHT_CUTOFF = 0.65;
const float ABBERATION_FACTOR = 0.05;
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.xy;
// Sample the original color
vec4 originalColor = texture(iChannel0, uv);
// Check if the pixel is part of the text (assuming alpha > 0.0)
if (originalColor.a > 0.0) {
float amount = offsetFunction(iTime);
vec3 col;
col.r = texture( iChannel0, vec2(uv.x-ABBERATION_FACTOR*amount / iResolution.x, uv.y) ).r;
col.g = texture( iChannel0, uv ).g;
col.b = texture( iChannel0, vec2(uv.x+ABBERATION_FACTOR*amount / iResolution.x, uv.y) ).b;
vec4 splittedColor = vec4(col, originalColor.a); // Keep the original alpha
vec4 source = toOklab(splittedColor);
vec4 dest = source;
if (source.x > DIM_CUTOFF) {
dest.x *= 1.2;
// dest.x = 1.2;
} else {
vec2 step = vec2(1.414) / iResolution.xy;
vec3 glow = vec3(0.0);
for (int i = 0; i < 24; i++) {
vec3 s = samples[i];
float weight = s.z;
vec4 c = toOklab(texture(iChannel0, uv + s.xy * step));
if (c.x > DIM_CUTOFF) {
glow.yz += c.yz * weight * 0.3;
if (c.x <= BRIGHT_CUTOFF) {
glow.x += c.x * weight * 0.05;
} else {
glow.x += c.x * weight * 0.10;
}
}
}
// float lightness_diff = clamp(glow.x - dest.x, 0.0, 1.0);
// dest.x = lightness_diff;
// dest.yz = dest.yz * (1.0 - lightness_diff) + glow.yz * lightness_diff;
dest.xyz += glow.xyz;
}
fragColor = toRgb(dest);
} else {
// If the pixel is background, set alpha to 0.0 for transparency
fragColor = vec4(originalColor.rgb, 0.0);
}
}

View file

@ -0,0 +1,145 @@
// First it does a "chromatic aberration" by splitting the rgb signals by a product of sin functions
// over time, then it does a glow effect in a perceptual color space
// Based on kalgynirae's Ghostty passable glow shader and NickWest's Chromatic Aberration shader demo
// Passable glow: https://github.com/kalgynirae/dotfiles/blob/main/ghostty/glow.glsl
// "Chromatic Aberration": https://www.shadertoy.com/view/Mds3zn
// sRGB linear -> nonlinear transform from https://bottosson.github.io/posts/colorwrong/
float f(float x) {
if (x >= 0.0031308) {
return 1.055 * pow(x, 1.0 / 2.4) - 0.055;
} else {
return 12.92 * x;
}
}
float f_inv(float x) {
if (x >= 0.04045) {
return pow((x + 0.055) / 1.055, 2.4);
} else {
return x / 12.92;
}
}
// Oklab <-> linear sRGB conversions from https://bottosson.github.io/posts/oklab/
vec4 toOklab(vec4 rgb) {
vec3 c = vec3(f_inv(rgb.r), f_inv(rgb.g), f_inv(rgb.b));
float l = 0.4122214708 * c.r + 0.5363325363 * c.g + 0.0514459929 * c.b;
float m = 0.2119034982 * c.r + 0.6806995451 * c.g + 0.1073969566 * c.b;
float s = 0.0883024619 * c.r + 0.2817188376 * c.g + 0.6299787005 * c.b;
float l_ = pow(l, 1.0 / 3.0);
float m_ = pow(m, 1.0 / 3.0);
float s_ = pow(s, 1.0 / 3.0);
return vec4(
0.2104542553 * l_ + 0.7936177850 * m_ - 0.0040720468 * s_,
1.9779984951 * l_ - 2.4285922050 * m_ + 0.4505937099 * s_,
0.0259040371 * l_ + 0.7827717662 * m_ - 0.8086757660 * s_,
rgb.a
);
}
vec4 toRgb(vec4 oklab) {
vec3 c = oklab.rgb;
float l_ = c.r + 0.3963377774 * c.g + 0.2158037573 * c.b;
float m_ = c.r - 0.1055613458 * c.g - 0.0638541728 * c.b;
float s_ = c.r - 0.0894841775 * c.g - 1.2914855480 * c.b;
float l = l_ * l_ * l_;
float m = m_ * m_ * m_;
float s = s_ * s_ * s_;
vec3 linear_srgb = vec3(
4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
-0.0041960863 * l - 0.7034186147 * m + 1.7076147010 * s
);
return vec4(
clamp(f(linear_srgb.r), 0.0, 1.0),
clamp(f(linear_srgb.g), 0.0, 1.0),
clamp(f(linear_srgb.b), 0.0, 1.0),
oklab.a
);
}
// Bloom samples from https://gist.github.com/qwerasd205/c3da6c610c8ffe17d6d2d3cc7068f17f
const vec3[24] samples = {
vec3(0.1693761725038636, 0.9855514761735895, 1),
vec3(-1.333070830962943, 0.4721463328627773, 0.7071067811865475),
vec3(-0.8464394909806497, -1.51113870578065, 0.5773502691896258),
vec3(1.554155680728463, -1.2588090085709776, 0.5),
vec3(1.681364377589461, 1.4741145918052656, 0.4472135954999579),
vec3(-1.2795157692199817, 2.088741103228784, 0.4082482904638631),
vec3(-2.4575847530631187, -0.9799373355024756, 0.3779644730092272),
vec3(0.5874641440200847, -2.7667464429345077, 0.35355339059327373),
vec3(2.997715703369726, 0.11704939884745152, 0.3333333333333333),
vec3(0.41360842451688395, 3.1351121305574803, 0.31622776601683794),
vec3(-3.167149933769243, 0.9844599011770256, 0.30151134457776363),
vec3(-1.5736713846521535, -3.0860263079123245, 0.2886751345948129),
vec3(2.888202648340422, -2.1583061557896213, 0.2773500981126146),
vec3(2.7150778983300325, 2.5745586041105715, 0.2672612419124244),
vec3(-2.1504069972377464, 3.2211410627650165, 0.2581988897471611),
vec3(-3.6548858794907493, -1.6253643308191343, 0.25),
vec3(1.0130775986052671, -3.9967078676335834, 0.24253562503633297),
vec3(4.229723673607257, 0.33081361055181563, 0.23570226039551587),
vec3(0.40107790291173834, 4.340407413572593, 0.22941573387056174),
vec3(-4.319124570236028, 1.159811599693438, 0.22360679774997896),
vec3(-1.9209044802827355, -4.160543952132907, 0.2182178902359924),
vec3(3.8639122286635708, -2.6589814382925123, 0.21320071635561041),
vec3(3.3486228404946234, 3.4331800232609, 0.20851441405707477),
vec3(-2.8769733643574344, 3.9652268864187157, 0.20412414523193154)
};
float offsetFunction(float iTime) {
float amount = 1.0;
const float periods[4] = {6.0, 16.0, 19.0, 27.0};
for (int i = 0; i < 4; i++) {
amount *= 1.0 + 0.5 * sin(iTime*periods[i]);
}
//return amount;
return amount * periods[3];
}
const float DIM_CUTOFF = 0.35;
const float BRIGHT_CUTOFF = 0.65;
const float ABBERATION_FACTOR = 0.05;
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.xy;
float amount = offsetFunction(iTime);
vec3 col;
col.r = texture( iChannel0, vec2(uv.x-ABBERATION_FACTOR*amount / iResolution.x, uv.y) ).r;
col.g = texture( iChannel0, uv ).g;
col.b = texture( iChannel0, vec2(uv.x+ABBERATION_FACTOR*amount / iResolution.x, uv.y) ).b;
vec4 splittedColor = vec4(col, 1.0);
vec4 source = toOklab(splittedColor);
vec4 dest = source;
if (source.x > DIM_CUTOFF) {
dest.x *= 1.2;
// dest.x = 1.2;
} else {
vec2 step = vec2(1.414) / iResolution.xy;
vec3 glow = vec3(0.0);
for (int i = 0; i < 24; i++) {
vec3 s = samples[i];
float weight = s.z;
vec4 c = toOklab(texture(iChannel0, uv + s.xy * step));
if (c.x > DIM_CUTOFF) {
glow.yz += c.yz * weight * 0.3;
if (c.x <= BRIGHT_CUTOFF) {
glow.x += c.x * weight * 0.05;
} else {
glow.x += c.x * weight * 0.10;
}
}
}
// float lightness_diff = clamp(glow.x - dest.x, 0.0, 1.0);
// dest.x = lightness_diff;
// dest.yz = dest.yz * (1.0 - lightness_diff) + glow.yz * lightness_diff;
dest.xyz += glow.xyz;
dest.a = 0.5;
}
fragColor = toRgb(dest);
}

View file

@ -0,0 +1,33 @@
{
config,
lib,
...
}: let
cfg = config.lily.git;
in {
options.lily.git = {
enable = lib.mkEnableOption "activate git";
};
config = lib.mkIf cfg.enable {
programs.git = {
enable = true;
lfs.enable = true;
extraConfig = {
user = {
name = "Lily";
email = "Caznix01@gmail.com";
signingKey = "Caznix";
};
commit.gpgsign = true;
init.defaultBranch = "main";
merge = {
ff = "no";
no-commit = "yes";
};
pull.ff = "only";
push = {autoSetupRemote = true;};
};
};
};
}

View file

@ -0,0 +1,116 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.lily.hyprland;
in {
options.lily.hyprland = {
enable = lib.mkEnableOption "activate hyprland";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
wl-clipboard
];
programs.kitty.enable = true; # required for the default Hyprland config
wayland.windowManager.hyprland = {
enable = true;
settings = {
decoration = {
rounding = 10;
# rounding_power = 2;
blur = {
enabled = true;
size = 10;
passes = 3;
popups = true;
xray = true;
};
};
blurls = "waybar";
dwindle = {
pseudotile = true; # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true; # You probably want this
};
general = {
resize_on_border = true; # Enables resizing by dragging window borders
extend_border_grab_area = 15; # Extends the clickable area around the border for resizing
hover_icon_on_border = true; # Shows a cursor icon when
layout = "dwindle";
"col.active_border" = "rgba(C55900ee) rgba(FFAA63ee) 45deg";
"col.inactive_border" = "rgba(595959aa)";
border_size = 2;
gaps_out = 10;
};
exec-once = [
"${pkgs.kdePackages.kwallet-pam}/libexec/pam_kwallet_init"
"${pkgs.networkmanagerapplet}/bin/nm-applet"
"${pkgs.blueman}/bin/blueman-applet"
];
"$super" = "SUPER";
"$alt_super" = "CTRL";
bind = [
"$super, Q, killactive"
"$alt_super $super,Q,exit"
# Screenshot region
"$super SHIFT,S, exec, GRIM_DEFAULT_DIR=${config.home.homeDirectory}/Pictures/Screenshots/ ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | wl-copy "
"$super,T, exec, ghostty"
"$super, L,exec, hyprlock --immediate"
"$super, B,exec, chromium"
"$super,F,fullscreen"
"$super SHIFT,F,togglefloating"
"$super,E,exec,kate"
"ALT,SPACE,exec, rofi -show drun"
"$super, P, pseudo,"
"$super, 1, workspace, 1"
"$super, 2, workspace, 2"
"$super, 3, workspace, 3"
"$super, 4, workspace, 4"
"$super, 5, workspace, 5"
"$super, 6, workspace, 6"
"$super, 7, workspace, 7"
"$super, 8, workspace, 8"
"$super, 9, workspace, 9"
"$super, 0, workspace, 10"
# Move active window to a workspace iwth mainMod + SHIFT + j
"$super SHIFT, 1, movetoworkspace, 1"
"$super SHIFT, 2, movetoworkspace, 2"
"$super SHIFT, 3, movetoworkspace, 3"
"$super SHIFT, 4, movetoworkspace, 4"
"$super SHIFT, 5, movetoworkspace, 5"
"$super SHIFT, 6, movetoworkspace, 6"
"$super SHIFT, 7, movetoworkspace, 7"
"$super SHIFT, 8, movetoworkspace, 8"
"$super SHIFT, 9, movetoworkspace, 9"
"$super SHIFT, 0, movetoworkspace, 10"
"$super, J, togglesplit"
"$super, left, movefocus, l"
"$super, right, movefocus, r"
"$super, up, movefocus, u"
"$super, down, movefocus, d"
];
bindm = [
"$super, mouse:272, movewindow"
"$super, mouse:273, resizewindow"
];
bindel = [
",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
",XF86MonBrightnessUp, exec, ${pkgs.brightnessctl}/bin/brightnessctl s 10%+"
",XF86MonBrightnessDown, exec, ${pkgs.brightnessctl}/bin/brightnessctl s 10%-"
];
};
};
};
}

View file

@ -0,0 +1,42 @@
{...}: {
programs.nixvim = {
colorschemes.catppuccin = {
enable = true;
settings = {
flavour = "mocha";
background = {
light = "latte";
dark = "mocha";
};
transparent_background = true;
show_end_of_buffer = false;
term_colors = false;
dim_inactive.enabled = false;
no_italic = false;
no_bold = false;
styles = {
comments = ["italic"];
conditionals = ["italic"];
loops = null;
functions = null;
keywords = null;
strings = null;
variables = null;
numbers = null;
booleans = null;
properties = null;
types = null;
operators = null;
};
integrations = {
cmp = true;
gitsigns = true;
nvimtree = true;
telescope = true;
notify = false;
mini = false;
};
};
};
};
}

View file

@ -0,0 +1,32 @@
{
pkgs,
nixvim,
config,
lib,
...
}: let
cfg = config.lily.neovim;
in {
imports = [
# ./colorscheme.nix
./plugins
./keybinds.nix
];
options.lily.neovim = {
enable = lib.mkEnableOption "activate neovim";
};
config = lib.mkIf cfg.enable {
programs.nixvim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
performance = {
byteCompileLua.enable = true;
combinePlugins = {};
};
};
};
}

View file

@ -0,0 +1,32 @@
{...}: {
programs.nixvim = {
globals = {
mapleader = " ";
maplocalleader = " ";
};
keymaps = [
{
mode = ["n" "v"];
key = "<SPACE>";
action = "<NOP>";
options.silent = true;
}
{
mode = "n";
key = "<LEADER>,";
action = "A,<ESC>";
options.silent = true;
}
{
mode = "n";
key = "<LEADER>sf";
action.__raw = "require('telescope.builtin').find_files";
options = {
silent = true;
desc = "[S]earch [F]iles";
};
}
];
};
}

View file

@ -0,0 +1,24 @@
{...}: {
imports = [
./telescope.nix
./lualine.nix
./treesitter.nix
./gitsigns.nix
./tree.nix
./lsp
# ./dap.nix
];
programs.nixvim.plugins = {
sleuth.enable = true;
comment.enable = true;
indent-blankline.enable = true;
web-devicons.enable = true;
fugitive.enable = true;
markdown-preview.enable = true;
git-worktree = {
enable = true;
enableTelescope = true;
};
};
}

View file

@ -0,0 +1,45 @@
{...}: {
programs.nixvim.plugins.gitsigns = {
enable = true;
settings = {
signs = {
add.text = "";
change.text = "";
delete.text = "";
topdelete.text = "";
changedelete.text = "";
};
signs_staged_enable = true;
signcolumn = true;
numhl = false;
linehl = false;
word_diff = false;
watch_gitdir = {
interval = 1000;
follow_files = true;
};
attach_to_untracked = true;
current_line_blame = false;
current_line_blame_opts = {
virt_text = true;
virt_text_pos = "eol";
delay = 100;
ignore_whitespace = true;
};
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> <summary>";
sign_priority = 6;
status_formatter = null;
update_debounce = 200;
max_file_length = 40000;
preview_config = {
border = "rounded";
style = "minimal";
relative = "cursor";
row = 0;
col = 1;
};
};
};
}

View file

@ -0,0 +1,85 @@
{...}: {
programs.nixvim.plugins = {
cmp = {
autoEnableSources = false;
enable = true;
settings = {
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
formatting = {
fields = ["kind" "abbr" "menu"];
format = ''
function(entry, vim_item)
local kind_icons = {
Text = "󰉿",
Method = "󰆧",
Function = "󰊕",
Constructor = "",
Field = " ",
Variable = "󰀫",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "󰑭",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "",
Event = "",
Operator = "󰆕",
TypeParameter = " ",
Misc = " ",
}
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
vim_item.abbr = vim_item.abbr .. " " .. (vim_item.menu and vim_item.menu or "")
if vim.fn.strchars(vim_item.abbr) > 50 then
vim_item.abbr = vim.fn.strcharpart(vim_item.abbr, 0, 50) .. "..."
end
vim_item.menu = ({
nvim_lsp = "[LSP]",
luasnip = "[Snippet]",
buffer = "[Buffer]",
path = "[Path]"
})[entry.source.name]
return vim_item
end
'';
};
mapping.__raw = '' cmp.mapping.preset.insert({
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
["<S-TAB>"] = cmp.mapping.select_prev_item(),
["<TAB>"] = cmp.mapping.select_next_item(),
})'';
window = {
completion.__raw = "cmp.config.window.bordered()";
documentation.__raw = "cmp.config.window.bordered()";
};
sources = [
{name = "nvim_lsp";}
{name = "luasnip";}
{name = "path";}
{name = "buffer";}
{name = "crates";}
];
};
};
cmp_luasnip.enable = true;
cmp-buffer.enable = true;
cmp-path.enable = true;
cmp-nvim-lsp.enable = true;
luasnip.enable = true;
};
}

View file

@ -0,0 +1,192 @@
{pkgs, ...}: {
imports = [
./cmp.nix
];
programs.nixvim.plugins = {
crates.enable = true; # Does not work
dressing.enable = true;
};
programs.nixvim.extraConfigVim = ''
augroup unrecognized_filetypes
autocmd!
autocmd BufRead,BufNewFile *.vert set filetype=glsl
autocmd BufRead,BufNewFile *.tesc set filetype=glsl
autocmd BufRead,BufNewFile *.tese set filetype=glsl
autocmd BufRead,BufNewFile *.frag set filetype=glsl
autocmd BufRead,BufNewFile *.geom set filetype=glsl
autocmd BufRead,BufNewFile *.comp set filetype=glsl
autocmd BufRead,BufNewFile *.qml set filetype=qml
autocmd BufRead,BufNewFile *.slint set filetype=slint
autocmd BufRead,BufNewFile *.typ set filetype=typst
augroup END
'';
programs.nixvim.plugins.lsp = {
enable = true;
capabilities = ''
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
capabilities.textDocument.completion.completionItem.snippetSupport = true'';
preConfig = ''
local border = {
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" }
}
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border })
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border })
'';
inlayHints = true;
servers = {
clangd = {
enable = true;
settings.arguments = [
"--clang-tidy"
"--background-index"
"--completion-style=detailed"
"--cross-file-rename"
"--header-insertion=iwyu"
"--all-scopes-completion"
];
};
# jdtls.enable = true;
emmet_ls.enable = true;
ts_ls.enable = true;
cssls.enable = true;
# glsl_analyzer.enable = true;
glslls.enable = true;
pyright.enable = true;
nixd.enable = true;
lua_ls = {
enable = true;
settings = {
telemetry.enable = false;
workspace.checkThirdParty = false;
};
};
svelte = {
enable = true;
settings.enable_ts_plugin = true;
};
slint_lsp.enable = true;
zls.enable = true;
rust_analyzer = {
enable = true;
installRustc = false;
installCargo = false;
settings = {
imports = {
granularity.group = "crate";
prefix = "self";
preferNoStd = true;
};
check = {
command = "clippy";
allTargets = true;
};
completion = {
fullFunctionSignatures.enable = false;
autoimport.enable = true;
};
cargo = {
allTargets = true;
features = "all";
};
procMacro.enable = true;
};
};
};
keymaps = {
silent = true;
extra = [
{
mode = "n";
key = "<leader>rn";
action.__raw = "vim.lsp.buf.rename";
}
{
mode = "n";
key = "<leader>ca";
action.__raw = "vim.lsp.buf.code_action";
}
{
mode = "n";
key = "<leader>di";
action.__raw = "vim.diagnostic.open_float";
}
{
mode = "n";
key = "<leader>dv";
action.__raw = "require('telescope.builtin').diagnostics";
}
{
mode = "n";
key = "gd";
action.__raw = "vim.lsp.buf.definition";
}
{
mode = "n";
key = "gr";
action.__raw = "require('telescope.builtin').lsp_references";
}
{
mode = "n";
key = "gI";
action.__raw = "vim.lsp.buf.implementation";
}
{
mode = "n";
key = "<leader>D";
action.__raw = "vim.lsp.buf.type_definition";
}
{
mode = "n";
key = "<leader>ds";
action.__raw = "require('telescope.builtin').lsp_document_symbols";
}
{
mode = "n";
key = "<leader>ws";
action.__raw = "require('telescope.builtin').lsp_dynamic_workspace_symbols";
}
{
mode = "n";
key = "<leader>K";
action.__raw = "vim.lsp.buf.hover";
}
{
mode = "n";
key = "<leader>k";
action.__raw = "vim.lsp.buf.signature_help";
}
{
mode = "n";
key = "<leader>gD";
action.__raw = "vim.lsp.buf.declaration";
}
{
mode = "n";
key = "<leader>wa";
action.__raw = "vim.lsp.buf.add_workspace_folder";
}
{
mode = "n";
key = "<leader>wr";
action.__raw = "vim.lsp.buf.remove_workspace_folder";
}
{
mode = "n";
key = "<leader>wl";
action.__raw = "function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end";
}
];
};
};
}

View file

@ -0,0 +1,21 @@
{...}: {
programs.nixvim.plugins.lualine = {
enable = true;
settings = {
options = {
icons_enabled = true;
component_seperators = {
left = "|";
right = "|";
};
section_seperators = {
left = "";
right = "";
};
disabled_filetypes.statusline = ["NvimTree" "alpha"];
disabled_filetypes.winbar = ["NvimTree" "alpha"];
theme = null;
};
};
};
}

View file

@ -0,0 +1,47 @@
{...}: {
programs.nixvim.plugins.telescope = {
enable = true;
extensions = {
fzf-native.enable = true;
file-browser.enable = true;
};
settings = {
theme = "dropdown";
defaults = {
prompt_prefix = " ";
selection_caret = " ";
entry_prefix = " ";
initial_mode = "insert";
selection_strategy = "reset";
layout_config = {};
mappings.i = {
"<C-u>" = false;
"<C-d>" = false;
};
file_ignore_patters = {};
path_display = "smart";
winblend = 0;
border = {};
borderchars = null;
color_devicons = true;
set_env = {COLORTERM = "truecolor";};
};
pickers = {
planets = {
show_pluto = true;
show_moon = true;
};
git_files = {
hidden = true;
show_untracked = true;
};
colorscheme = {
enable_preview = true;
};
find_files = {
hidden = true;
};
};
};
};
}

View file

@ -0,0 +1,17 @@
{
programs.nixvim.plugins.nvim-tree = {
enable = true;
disableNetrw = true;
hijackNetrw = true;
diagnostics.enable = true;
preferStartupRoot = false;
syncRootWithCwd = true;
view = {
side = "left";
width = 30;
};
renderer.groupEmpty = true;
actions.openFile.resizeWindow = true;
git.ignore = false;
};
}

View file

@ -0,0 +1,19 @@
{config, ...}: {
programs.nixvim.plugins.treesitter = {
enable = true;
nixvimInjections = true;
settings = {
indent.enable = true;
incremental_selection = {
enable = true;
# keymaps = {
# init_selection = "<c-space>";
# node_incremental = "<c-space>";
# scope_incremental = "<c-s";
# node_decremental = "<c-backspace>";
# };
};
highlight.enable = true;
};
};
}

View file

@ -0,0 +1,20 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.lily.rofi;
in {
options.lily.rofi = {
enable = lib.mkEnableOption "activate rofi";
};
config = lib.mkIf cfg.enable {
programs.rofi = {
package = pkgs.rofi-wayland;
enable = true;
plugins = [pkgs.rofi-calc];
};
};
}

View file

@ -0,0 +1,84 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.lily.vscode;
in {
options.lily.vscode = {
enable = lib.mkEnableOption "activate vscode";
};
config = lib.mkIf cfg.enable {
programs.vscode = {
enable = true;
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
mutableExtensionsDir = false;
package = pkgs.vscode.overrideAttrs (attrs: {
buildInputs = with pkgs;
attrs.buildInputs
++ [
bun
gcc
cmake
ninja
];
});
extensions = with pkgs.vscode-extensions; [
github.copilot
github.copilot-chat
rust-lang.rust-analyzer
svelte.svelte-vscode
bradlc.vscode-tailwindcss
ms-vsliveshare.vsliveshare
ms-vscode.cmake-tools
ms-python.python
vadimcn.vscode-lldb
bierner.markdown-preview-github-styles
bierner.markdown-checkbox
bierner.markdown-emoji
bierner.markdown-footnotes
bierner.markdown-mermaid
denoland.vscode-deno
ziglang.vscode-zig
# geequlim.godot-tools
gruntfuggly.todo-tree
mhutchie.git-graph
fill-labs.dependi
bbenoist.nix
tamasfe.even-better-toml
twxs.cmake
llvm-vs-code-extensions.vscode-clangd
mkhl.direnv
(pkgs.vscode-utils.buildVscodeMarketplaceExtension {
mktplcRef = {
name = "darcula-solid";
publisher = "jussiemion";
version = "1.2.1";
hash = "sha256-tIfCkOR1Z/uRWiZhrBfOQCZT3Cu6yNjAnxjn0UJFO2U=";
};
})
];
userSettings = {
"editor.cursorSmoothCaretAnimation" = "on";
"editor.smoothScrolling" = true;
"editor.cursorBlinking" = "expand";
"workbench.colorTheme" = "Darcula Solid";
"clangd.path" = "${pkgs.clang-tools}/bin/clangd";
"clangd.arguments" = [
"--clang-tidy"
"--background-index"
"--completion-style=detailed"
"--cross-file-rename"
"--header-insertion=iwyu"
"--all-scopes-completion"
];
"editor.fontFamily" = "JetBrainsMono Nerd Font";
"zig.path" = "${pkgs.zls}/bin/zls";
};
};
};
}

View file

@ -0,0 +1,18 @@
{
config,
lib,
...
}: let
cfg = config.lily.waybar;
in {
options.lily.waybar = {
enable = lib.mkEnableOption "activate waybar";
};
config = lib.mkIf cfg.enable {
programs.waybar = {
enable = true;
systemd.enable = true;
};
};
}

View file

@ -0,0 +1,103 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.lily.zed;
in {
options.lily.zed = {
enable = lib.mkEnableOption "activate zed";
};
config = lib.mkIf cfg.enable {
programs.zed-editor = {
enable = true;
extensions = ["nix" "toml" "elixir" "make"];
## everything inside of these brackets are Zed options.
userSettings = {
assistant = {
enabled = true;
version = "2";
default_open_ai_model = null;
### PROVIDER OPTIONS
### zed.dev models { claude-3-5-sonnet-latest } requires github connected
### anthropic models { claude-3-5-sonnet-latest claude-3-haiku-latest claude-3-opus-latest } requires API_KEY
### copilot_chat models { gpt-4o gpt-4 gpt-3.5-turbo o1-preview } requires github connected
default_model = {
provider = "zed.dev";
model = "claude-3-5-sonnet-latest";
};
# inline_alternatives = [
# {
# provider = "copilot_chat";
# model = "gpt-3.5-turbo";
# }
# ];
};
node = {
path = lib.getExe pkgs.nodejs;
npm_path = lib.getExe' pkgs.nodejs "npm";
};
hour_format = "hour24";
auto_update = false;
terminal = {
alternate_scroll = "off";
blinking = "off";
copy_on_select = false;
dock = "bottom";
detect_venv = {
on = {
directories = [".env" "env" ".venv" "venv"];
activate_script = "default";
};
};
font_family = "JetBrains Mono";
font_features = null;
font_size = null;
line_height = "comfortable";
option_as_meta = false;
button = false;
shell = {
program = "zsh";
};
toolbar = {
title = true;
};
working_directory = "current_project_directory";
};
lsp = {
rust-analyzer = {
binary = {
path = "/run/current-system/sw/bin/rust-analyzer";
path_lookup = false;
};
};
nix = {
binary = {
path = "${pkgs.nixd}/bin/nixd";
path_lookup = false;
};
};
};
vim_mode = false; # Not yet...
load_direnv = "shell_hook";
base_keymap = "VSCode";
theme = {
mode = "system";
light = "One Light";
dark = "Andromeda";
};
show_whitespaces = "all";
ui_font_size = 16;
buffer_font_size = 16;
};
};
};
}

View file

@ -0,0 +1,53 @@
{
config,
lib,
...
}: let
cfg = config.lily.zsh;
in {
options.lily.zsh = {
enable = lib.mkEnableOption "activate zsh";
};
config = lib.mkIf cfg.enable {
programs.zsh = {
enable = true;
autocd = true;
autosuggestion.enable = true;
autosuggestion.strategy = [
"completion"
"history"
];
shellAliases = {
nix-switch = "sudo nixos-rebuild switch --flake $HOME/.dotfiles";
ls = "eza";
cd = "z";
};
syntaxHighlighting.enable = true;
antidote = {
enable = true;
plugins = [
"zsh-users/zsh-autosuggestions"
"mattmc3/ez-compinit"
"zdharma-continuum/fast-syntax-highlighting kind:defer"
"zsh-users/zsh-completions kind:fpath path:src"
"getantidote/use-omz" # handle OMZ dependencies
"ohmyzsh/ohmyzsh path:lib" # load OMZ's library
"ohmyzsh/ohmyzsh path:plugins/colored-man-pages" # load OMZ plugins
"ohmyzsh/ohmyzsh path:plugins/magic-enter"
];
};
};
programs.zoxide = {
enable = true;
};
programs.starship.enable = true;
programs.eza = {
enable = true;
colors = "always";
icons = "always";
git = true;
};
};
}