initial refactoring

This commit is contained in:
Noah Masur
2025-01-20 22:35:40 -05:00
parent a4b5e05f8f
commit c7933f8502
209 changed files with 5998 additions and 5308 deletions

View File

@ -0,0 +1,29 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.nmasur.profiles.common;
in
{
options.nmasur.profiles.common.enable = lib.mkEnableOption "Common home-manager config";
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
dig # DNS lookup
fd # find
htop # Show system processes
killall # Force quit
inetutils # Includes telnet, whois
jq # JSON manipulation
rsync # Copy folders
ripgrep # grep
sd # sed
unzip # Extract zips
];
};
}

View File

@ -0,0 +1,32 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.nmasur.profiles.darwin-base;
in
{
options.nmasur.profiles.darwin-base.enable = lib.mkEnableOption "Base macOS home-manager config";
config = lib.mkIf cfg.enable {
# Default shell setting doesn't work
home.sessionVariables = {
SHELL = "${pkgs.fish}/bin/fish";
};
# Used for aerc
xdg.enable = true;
home.packages = [
pkgs.noti # Create notifications programmatically
];
};
# Fix for: 'Error: HOME is set to "/var/root" but we expect "/var/empty"'
# home-manager.users.root.home.homeDirectory = lib.mkForce "/var/root";
}

View File

@ -0,0 +1,24 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.nmasur.profiles.developer;
in
{
options.nmasur.profiles.developer.enable = lib.mkEnableOption "Developer tools";
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
pgcli # Postgres client with autocomplete
];
};
}

View File

@ -0,0 +1,57 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.nmasur.profiles.common;
in
{
options.nmasur.profiles.common.enable = lib.mkEnableOption "Extra home-manager config";
config = lib.mkIf cfg.enable {
home.packages = lib.mkDefault [
pkgs.age # Encryption
pkgs.bc # Calculator
pkgs.delta # Fancy diffs
pkgs.difftastic # Other fancy diffs
pkgs.jless # JSON viewer
pkgs.jo # JSON output
pkgs.osc # Clipboard over SSH
pkgs.qrencode # Generate qr codes
# pkgs.ren # Rename files
# pkgs.rep # Replace text in files
pkgs.spacer # Output lines in terminal
pkgs.tealdeer # Cheatsheets
pkgs.vimv-rs # Batch rename files
pkgs.dua # File sizes (du)
pkgs.du-dust # Disk usage tree (ncdu)
pkgs.duf # Basic disk information (df)
pkgs.pandoc # Convert text documents
pkgs.mpd # TUI slideshows
];
programs.zoxide.enable = lib.mkDefault true; # Shortcut jump command
programs.fish.shellAliases = {
"cd" = lib.mkDefault "${pkgs.zoxide}/bin/zoxide";
"du" = lib.mkDefault "${pkgs.dua}/bin/dua";
"ncdu" = lib.mkDefault "${pkgs.du-dust}/bin/du-dust";
"df" = lib.mkDefault "${pkgs.duf}/bin/duf";
# Use eza (exa) instead of ls for fancier output
ls = "${pkgs.eza}/bin/eza --group";
# Version of bash which works much better on the terminal
bash = "${pkgs.bashInteractive}/bin/bash";
};
config.nmasur.presets.bat.enable = lib.mkDefault true;
config.nmasur.presets.fd.enable = lib.mkDefault true;
config.nmasur.presets.ripgrep.enable = lib.mkDefault true;
config.nmasur.presets.prettyping.enable = lib.mkDefault true;
config.nmasur.presets.weather.enable = lib.mkDefault true;
};
}

View File

@ -0,0 +1,31 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.nmasur.profiles.fun;
in
{
options.nmasur.profiles.fun.enable = lib.mkEnableOption "Fun tools";
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
# Charm tools
glow # Markdown previews
skate # Key-value store
charm # Manage account and filesystem
pop # Send emails from a TUI
];
};
}

View File

@ -0,0 +1,43 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.nmasur.profiles.linux-base;
in
{
options.nmasur.profiles.linux-base.enable = lib.mkEnableOption "Base Linux home-manager config";
config = lib.mkIf cfg.enable {
# Allow Nix to manage the default applications list
mimeApps.enable = true;
# Set directories for application defaults
userDirs = {
enable = true;
createDirectories = true;
documents = "$HOME/documents";
download = config.userDirs.download;
music = "$HOME/media/music";
pictures = "$HOME/media/images";
videos = "$HOME/media/videos";
desktop = "$HOME/other/desktop";
publicShare = "$HOME/other/public";
templates = "$HOME/other/templates";
extraConfig = {
XDG_DEV_DIR = "$HOME/dev";
};
};
programs.fish.shellAliases = {
# Move files to XDG trash on the commandline
trash = "${pkgs.trash-cli}/bin/trash-put";
};
};
}

View File

@ -0,0 +1,48 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.nmasur.profiles.linux-gui;
in
{
options.nmasur.profiles.linux-gui.enable = lib.mkEnableOption "Linux GUI home";
config = lib.mkIf cfg.enable {
# Cursor
home.pointerCursor = {
name = "Adwaita";
package = pkgs.adwaita-icon-theme;
size = 24;
gtk.enable = true;
x11.enable = true;
};
# Enable num lock on login
xsession.numlock.enable = true;
# Dark theme
gtk =
let
gtkExtraConfig = {
gtk-application-prefer-dark-theme = config.theme.dark;
};
in
{
enable = true;
theme = {
name = config.gtk.theme.name;
package = config.gtk.theme.package;
};
gtk3.extraConfig = gtkExtraConfig;
gtk4.extraConfig = gtkExtraConfig;
};
};
}

View File

@ -0,0 +1,63 @@
{
config,
pkgs,
lib,
...
}:
let
cfg = config.nmasur.profiles.work;
in
{
options.nmasur.profiles.work.enable = lib.mkEnableOption "work config";
config = lib.mkIf cfg.enable {
unfreePackages = [
"vault-bin"
# "teams"
];
home.packages = [
pkgs.visidata # CSV inspector
pkgs.dos2unix # Convert Windows text files
pkgs.inetutils # Includes telnet
pkgs.gnupg # Encryption
pkgs.awscli2
pkgs.ssm-session-manager-plugin
pkgs.awslogs
pkgs.stu # TUI for AWS S3
pkgs.google-cloud-sdk
pkgs.vault-bin
pkgs.ipcalc # Make IP network calculations
pkgs.cloudflared # Allow connecting to Cloudflare tunnels
pkgs.monitorcontrol # Allows adjusting external displays
(pkgs.writeShellApplication {
name = "ocr";
runtimeInputs = [ pkgs.tesseract ];
text = builtins.readFile ../../modules/common/shell/bash/scripts/ocr.sh;
})
(pkgs.writeShellApplication {
name = "ec2";
runtimeInputs = [
pkgs.awscli2
pkgs.jq
pkgs.fzf
];
text = builtins.readFile ../../modules/common/shell/bash/scripts/aws-ec2.sh;
})
(pkgs.writeShellApplication {
name = "tfinit";
runtimeInputs = [
pkgs.terraform
pkgs.gawk
pkgs.git
];
text = builtins.readFile ../../modules/common/shell/bash/scripts/terraform-init.sh;
})
];
};
}