nixos/nate/modules/home-manager/home.nix

268 lines
6.3 KiB
Nix

{ inputs, config, pkgs, lib, ... }:
let
userName = "nate";
fullName = "Nathan Anderson";
email = "n8r@tuta.io";
unstable = import inputs.nixpkgs-unstable { system = "x86_64-linux"; config.allowUnfree = true; };
in
{
imports = [
../../../shared/modules/apps/firefox/firefox.nix
../../../shared/modules/apps/ghostty.nix
../../../shared/modules/apps/helix.nix
../../../shared/modules/home-manager/programs.nix
../../../shared/modules/home-manager/git-autosync.nix
../niri/niri_home.nix
];
home.username = userName;
home.homeDirectory = "/home/${userName}";
programs.home-manager.enable = true;
home.stateVersion = "23.11"; # Please read the comment before changing.
# Stylix auto-theming - applies to all programs.<name>.enable apps
stylix.autoEnable = true;
# Enable shared modules
firefoxApp.enable = true;
ghosttyApp.enable = true;
helixApp.enable = true;
sharedPrograms.enable = true;
fonts.fontconfig.enable = true;
# Git autosync for star-command
services.git-autosync = {
enable = true;
repos.star-command = {
path = "/home/${userName}/source/star-command";
gitName = fullName;
gitEmail = email;
};
};
nirihome = {
enable = true;
homePackages = [];
};
# Additional user packages
# Note: Programs with Stylix theming are in shared modules
home.packages = with pkgs; [
#
# Dev Tools
#
docker
unstable.godot
jq
python3
unstable.opencode
unstable.claude-code
usbutils
openscad
### LSP's
nil # Nix LSP
nodePackages_latest.bash-language-server
vscode-langservers-extracted # provides eslint, markdown, json, css, and html lsp
python313Packages.python-lsp-server
#
# Gaming
#
mumble
mangohud
wine-wayland
#
# Unix tools
#
duf
dust
fd
lsd
ripgrep
gtop
htop
unzip
#
# Photo / Video
#
unstable.davinci-resolve-studio
obs-studio
imv
ffmpeg
#
# Other
#
kdePackages.filelight
simple-scan
#
# Style (Qt plugin for Stylix)
#
libsForQt5.qtstyleplugin-kvantum
libsForQt5.qt5ct
# Additional fonts (main fonts managed by Stylix)
unstable.nerd-fonts.hurmit
unstable.nerd-fonts.overpass
recursive
];
home.file = lib.mkMerge [
# Shared dotfiles
(let
sharedDotfilesPath = ../../../shared/dotfiles;
in
if builtins.pathExists sharedDotfilesPath then
builtins.listToAttrs (map (name: {
name = "${config.xdg.configHome}/${name}";
value = { source = lib.mkDefault (sharedDotfilesPath + "/${name}"); };
}) (builtins.attrNames (builtins.readDir sharedDotfilesPath)))
else {})
# Add local dotfiles, overriding from local over shared
(let
localDotfilesPath = ../../dotfiles;
in
if builtins.pathExists localDotfilesPath && builtins.readDir localDotfilesPath != {} then
builtins.listToAttrs (map (name: {
name = "${config.xdg.configHome}/${name}";
value = { source = localDotfilesPath + "/${name}"; };
}) (builtins.attrNames (builtins.readDir localDotfilesPath)))
else {})
];
xdg.configFile = {
# Active linked dotfiles - use frame12's niri config as it's the most up-to-date
"niri".source = config.lib.file.mkOutOfStoreSymlink "/home/nate/nixos/frame12/linked-dotfiles/niri";
};
# Configure default applications for opening links
xdg.mimeApps = {
enable = true;
defaultApplications = {
"text/html" = "firefox.desktop";
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"x-scheme-handler/about" = "firefox.desktop";
"x-scheme-handler/unknown" = "firefox.desktop";
};
};
services.kdeconnect = {
enable = true;
indicator = true;
};
# enable saving ssh secrets (needed for go mod installing private packages)
services.gnome-keyring.enable = true;
services.gnome-keyring.components = [ "ssh" "secrets" ];
# Enable bluetooth headphone controls
services.mpris-proxy.enable = true;
# SwayOSD - on-screen display for volume, brightness, caps lock
services.swayosd = {
enable = true;
topMargin = 0.9;
};
# SwayNC - notification center (Stylix auto-themes this)
services.swaync = {
enable = true;
settings = {
positionX = "center";
positionY = "top";
notification-window-width = 800;
};
};
home.sessionVariables = {
EDITOR = "hx";
# For electron apps
NIXOS_OZONE_WL = "1";
};
# Git setup
programs.git = {
enable = true;
settings = {
user.name = fullName;
user.email = email;
init = { defaultBranch = "main"; };
merge = { conflictStyle="zdiff3"; };
pull = { ff = "only"; };
push = { autoSetupRemote="true"; };
url = {
"git@github.com:" = {
insteadOf = "https://github.com/";
};
};
};
};
# Better git diffs with delta
programs.delta = {
enable = true;
enableGitIntegration = true;
options = {
side-by-side = true;
hyperlinks = true;
};
};
# direnv for auto nix flake shells
programs = {
direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
bash.enable = true;
};
# Zsh setup
programs.zsh = {
enable = true;
oh-my-zsh = {
enable = true;
plugins = [ "git" ];
theme = "half-life";
extraConfig =
''
zstyle :omz:plugins:ssh-agent lazy yes
'';
};
initContent = ''
# integrate ssh-agent from gnome keyring
export SSH_AUTH_SOCK=/run/user/$UID/gcr/ssh
eval "$(direnv hook zsh)"
yt-audio() {
nix-shell -p yt-dlp --run "yt-dlp -x $1 --audio-format mp3"
}
'';
shellAliases = {
ls="lsd";
l="lsd --almost-all --long";
llm="lsd --timesort --long";
lS="lsd --oneline --classic";
lt="lsd --tree --depth=2";
cat="bat --paging=never";
rm="rm -i";
};
syntaxHighlighting = {
enable = true;
};
};
# Stylix handles Qt and GTK theming
services.wlsunset = {
enable = true;
sunrise = "07:00";
sunset = "17:00";
temperature.night = 3500;
};
}