uhhh the 2nd rendition
This commit is contained in:
Reid 2024-03-28 20:45:53 -07:00
parent 132a109da8
commit 565aac949c
37 changed files with 2606 additions and 36 deletions

View file

@ -0,0 +1,51 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.modules.software.dev.git;
in {
options.modules.software.dev.git = {
enable = mkEnableOption "Enable git. You know what git is";
};
config = mkIf cfg.enable {
hm.programs.git = {
enable = true;
package = pkgs.gitFull;
userName = ''Reid "reidlab"'';
userEmail = "reidlab325@gmail.com";
ignores = [
# OS related
".DS_Store?"
".DS_Store"
".CFUserTextEncoding"
".Trash"
".Xauthority"
"thumbs.db"
"Thumbs.db"
"Icon?"
];
aliases = {
ranked-authors = "!git authors | sort | uniq -c | sort -n";
emails = ''
!git log --format="%aE" | sort -u
'';
email-domains = ''
!git log --format="%aE" | awk -F'@' '{print $2}' | sort -u
'';
graph = ''
log --graph --color --pretty=format:"%C(yellow)%H%C(green)%d%C(reset)%n%x20%cd%n%x20%cn%x20(%ce)%n%x20%s%n"
'';
};
extraConfig = {
push.autoSetupRemote = true;
pull.rebase = true;
init.defaltBranch = "main";
};
};
};
}

View file

@ -0,0 +1,43 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.software.distractions.discord;
in {
options.modules.software.distractions.discord = {
enable = mkEnableOption "Enable discord, a social messaging app";
armcord = mkEnableOption "Use armcord, an alternative discord client.";
};
config = mkIf cfg.enable (mkMerge [
(mkIf (!cfg.armcord) {
user.packages = let
flags =
[
"--flag-switches-begin"
"--flag-switches-end"
"--disable-gpu-memory-buffer-video-frames"
"--enable-accelerated-mjpeg-decode"
"--enable-accelerated-video"
"--enable-gpu-rasterization"
"--enable-native-gpu-memory-buffers"
"--enable-zero-copy"
"--ignore-gpu-blocklist"
"--disable-features=UseOzonePlatform"
"--enable-features=VaapiVideoDecoder"
];
discord = (pkgs.discord-canary.override {
withOpenASAR = true;
withVencord = true;
}).overrideAttrs (old: {
preInstall = ''
gappsWrapperArgs=+("--add-flags" "${concatStringsSep " " flags}")
'';
});
in [ discord ];
})
(mkIf cfg.armcord {
user.packages = with pkgs; [ armcord ];
})
]);
}

View file

@ -0,0 +1,64 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.software.editors.micro;
in {
options.modules.software.editors.micro = {
enable = mkEnableOption "Enable micro, a simple CLI code editor";
};
config = let
schemeName = "generated";
in mkIf cfg.enable {
environment.variables.EDITOR = "micro";
hm.programs.micro = {
enable = true;
settings = {
autosu = true;
clipboard = "external";
savecursor = true;
scrollbar = true;
tabsize = 2;
tabstospaces = true;
colorScheme = schemeName;
};
};
hm.home.file.".config/micro/colorschemes/${schemeName}.micro".text = with config.colorScheme.palette; ''
color-link default "#${base05},#${base00}"
color-link comment "#${base03},#${base00}"
color-link identifier "#${base0D},#${base00}"
color-link constant "#${base0E},#${base00}"
color-link constant.string "#E6DB74,#${base00}"
color-link constant.string.char "#BDE6AD,#${base00}"
color-link statement "#${base08},#${base00}"
color-link symbol.operator "#${base08},#${base00}"
color-link preproc "#CB4B16,#${base00}"
color-link type "#${base0D},#${base00}"
color-link special "#${base0B},#${base00}"
color-link underlined "#D33682,#${base00}"
color-link error "bold #CB4B16,#${base00}"
color-link todo "bold #D33682,#${base00}"
color-link hlsearch "#${base00},#E6DB74"
color-link statusline "#${base00},#${base05}"
color-link tabbar "#${base00},#${base05}"
color-link indent-char "#505050,#${base00}"
color-link line-number "#AAAAAA,#${base01}"
color-link current-line-number "#AAAAAA,#${base00}"
color-link diff-added "#00AF00"
color-link diff-modified "#FFAF00"
color-link diff-deleted "#D70000"
color-link gutter-error "#CB4B16,#${base00}"
color-link gutter-warning "#E6DB74,#${base00}"
color-link cursor-line "#${base01}"
color-link color-column "#${base01}"
#No extended types; Plain brackets.
color-link type.extended "default"
#color-link symbol.brackets "default"
color-link symbol.tag "#${base0E},#${base00}"
'';
};
}

View file

@ -0,0 +1,59 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.software.editors.vscode;
in {
options.modules.software.editors.vscode = {
enable = mkEnableOption "Enable visual studio code, microsoft's gui code editor + IDE";
};
config = mkIf cfg.enable {
hm.programs.vscode = {
enable = true;
extensions = with pkgs.vscode-extensions; [
jnoortheen.nix-ide
oderwat.indent-rainbow
usernamehw.errorlens
ms-vsliveshare.vsliveshare
];
mutableExtensionsDir = false;
enableExtensionUpdateCheck = false;
enableUpdateCheck = false;
userSettings = with config.modules.desktop.fonts.fonts; {
"editor.fontFamily" = "'${monospace.family}', monospace";
"editor.fontSize" = monospace.size + 3; # needed??
"terminal.integrated.fontFamily" = "\"${monospace.family}\"";
"terminal.integrated.fontSize" = monospace.size + 3; # needed??
"telemetry.telemetryLevel" = "off";
"editor.tabSize" = 4;
"editor.cursorSmoothCaretAnimation" = "on";
"window.dialogStyle" = "custom";
"window.titleBarStyle" = "custom";
"workbench.tips.enabled" = false;
"nix.enableLanguageServer" = true;
"nix.serverPath" = "${lib.getExe pkgs.nil}";
"security.workspace.trust.untrustedFiles" = "open";
"explorer.confirmDelete" = false;
"explorer.confirmDragAndDrop" = true;
"editor.smoothScrolling" = true;
"editor.wordWrap" = "on";
"editor.wrappingStrategy" = "advanced";
"editor.fontWeight" = "normal";
"editor.semanticHighlighting.enabled" = true;
# prevent vscode from modifying the terminal colors
"terminal.integrated.minimumContrastRatio" = 1;
};
};
};
}

View file

@ -0,0 +1,30 @@
{ config, lib, pkgs, inputs, ... }:
with lib;
let
cfg = config.modules.software.system.fish;
nix-colors-lib = inputs.nix-colors.lib.contrib { inherit pkgs; };
in {
options.modules.software.system.fish = {
enable = mkEnableOption "Enable fish, the friendly interpreted shell";
};
config = mkIf cfg.enable {
user.packages = [ pkgs.grc ];
environment.systemPackages = with pkgs.fishPlugins; [ fzf-fish tide ];
users.defaultUserShell = pkgs.fish;
programs.fish.enable = true;
hm.programs.fish = let
colorScript = nix-colors-lib.shellThemeFromScheme { scheme = config.colorScheme; };
in {
enable = true;
plugins = [ { name = "grc"; src = pkgs.fishPlugins.grc.src; } ];
interactiveShellInit = ''
sh ${colorScript}
'';
# TODO: add fish greeting?
};
};
}

View file

@ -0,0 +1,42 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.software.system.wezterm;
in {
options.modules.software.system.wezterm = {
enable = mkEnableOption "Enable wezterm, a blazingly fast terminal emulator";
};
config = mkIf cfg.enable {
environment.variables.TERM = "wezterm";
hm.programs.wezterm = {
enable = true;
extraConfig = let
fonts = config.modules.desktop.fonts.fonts;
in ''
local wezterm = require 'wezterm'
local config = {}
config.font = wezterm.font '${fonts.monospaceBitmap.family}'
config.font_size = ${toString fonts.monospaceBitmap.size}
config.freetype_load_flags = 'MONOCHROME'
config.enable_wayland = false
config.color_scheme = 'Catppuccin Mocha'
config.use_fancy_tab_bar = false
config.use_resize_increments = true
config.initial_cols = 120
config.initial_rows = 40
config.window_frame = {
font = wezterm.font '${fonts.sans.family}',
font_size = ${toString fonts.sans.size}
}
return config
'';
};
};
}