refactor: moved user-specific nix modules into the users/modules directory

This commit is contained in:
Mohammad Rafiq 2025-03-01 06:01:40 +08:00
parent 169a8785ee
commit abfacba0aa
8 changed files with 11 additions and 9 deletions

7
users/modules/editor.nix Normal file
View file

@ -0,0 +1,7 @@
{self, pkgs, ...}:
{
home.packages = [
self.packages.${pkgs.stdenv.system}.nvf
];
}

15
users/modules/git.nix Normal file
View file

@ -0,0 +1,15 @@
{
home.sessionVariables.GIT_CONFIG_GLOBAL = "$HOME/.config/git/config";
programs.git = {
enable = true;
userName = "Mohammad Rafiq";
userEmail = "mohammadrafiq567@gmail.com";
extraConfig = {
init.defaultBranch = "prime";
push.autoSetupRemote = true;
pull.rebase = false;
core.editor = "nvim";
};
};
}

9
users/modules/sh.nix Normal file
View file

@ -0,0 +1,9 @@
{
programs.bash = {
enable = true;
shellAliases = {
rebuild = "sudo nixos-rebuild switch --flake";
gs = "git status";
};
};
}

View file

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
kitty # default terminal emulator for hyprland
];
}

9
users/modules/tmux.nix Normal file
View file

@ -0,0 +1,9 @@
{
programs.tmux = {
enable = true;
extraConfig = ''
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
'';
};
}

23
users/modules/utils.nix Normal file
View file

@ -0,0 +1,23 @@
{ pkgs, ... }:
{
# TODO: Move wayland-specific stuff to a wayland config
home.packages = with pkgs; [
fastfetch # system info
wl-clipboard # provides cli copy and paste commands
];
programs = {
# man page summaries (activate with tldr <command>)
tealdeer = {
enable = true;
enableAutoUpdates = true;
};
};
services = {
# clipboard history (depends on wl-clipboard)
cliphist.enable = true;
};
}

27
users/modules/wm.nix Normal file
View file

@ -0,0 +1,27 @@
{
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = false; # Required for UWSM compat
systemd.variables = ["--all"];
# Use tha packages defined in the system configuration
package = null;
portalPackage = null;
settings = {
monitor = [
"HDMI-A-2, 3840x2160@60, 0x0, 2"
"DP-4, 1920x1080@60, -1920x0, 1"
", preferred, auto, 1"
];
"$terminal" = "kitty";
"$browser" = "firefox";
"$mainMod" = "SUPER";
bind = [
"$mainMod, Q, exec, uwsm app -- $terminal"
"$mainMod, W, killactive"
"$mainMod, E, exec, uwsm app -- $browser"
"$mainMod, M, exec, uwsm stop"
];
debug.disable_logs = false;
};
};
}

View file

@ -1,14 +1,16 @@
{ self, pkgs, ... }:
{
self,
pkgs,
...
}: {
imports = [
../modules/home-git.nix # git specific configs
../modules/home-tmux.nix # tmux specific configs (might move this)
../modules/home-sh.nix # bash and other shell specific configs
../modules/home-wm.nix # window manager configs
../modules/home-editor.nix # editor specific configs
../modules/home-terminal.nix # terminal emulator configs
../modules/home-utils.nix # miscellaneous utilities
./modules/git.nix # git specific configs
./modules/tmux.nix # tmux specific configs (might move this)
./modules/sh.nix # bash and other shell specific configs
./modules/wm.nix # window manager configs
./modules/editor.nix # editor specific configs
./modules/terminal.nix # terminal emulator configs
./modules/utils.nix # miscellaneous utilities
];
# This enables using home-manager from the command line.