44
home/shahab/common/core/alacritty.nix
Normal file
44
home/shahab/common/core/alacritty.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
window = {
|
||||
padding = {
|
||||
x = 4;
|
||||
y = 8;
|
||||
};
|
||||
decorations = "full";
|
||||
opacity = 1;
|
||||
startup_mode = "Windowed";
|
||||
title = "Alacritty";
|
||||
dynamic_title = true;
|
||||
decorations_theme_variant = "None";
|
||||
};
|
||||
|
||||
env = {
|
||||
TERM = "xterm-256color";
|
||||
};
|
||||
|
||||
terminal.shell.program = "zsh";
|
||||
|
||||
font = {
|
||||
size = 14;
|
||||
normal.family = config.hostSpec.font;
|
||||
bold.family = config.hostSpec.font;
|
||||
italic.family = config.hostSpec.font;
|
||||
};
|
||||
|
||||
cursor = {
|
||||
style = "Block";
|
||||
};
|
||||
|
||||
general.live_config_reload = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
96
home/shahab/common/core/default.nix
Normal file
96
home/shahab/common/core/default.nix
Normal file
@@ -0,0 +1,96 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
hostSpec,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = lib.flatten [
|
||||
(map lib.custom.relativeToRoot [
|
||||
"modules/common"
|
||||
"modules/home-manager"
|
||||
])
|
||||
|
||||
./alacritty.nix
|
||||
./direnv.nix
|
||||
./git.nix
|
||||
./fonts.nix
|
||||
];
|
||||
|
||||
inherit hostSpec;
|
||||
|
||||
home = {
|
||||
username = lib.mkDefault config.hostSpec.username;
|
||||
homeDirectory = lib.mkDefault config.hostSpec.home;
|
||||
stateVersion = lib.mkDefault "25.05";
|
||||
sessionPath = [
|
||||
"$HOME/.local/bin"
|
||||
];
|
||||
sessionVariables = {
|
||||
FLAKE = "$HOME/src/nix/nix-config";
|
||||
SHELL = "zsh";
|
||||
TERM = "alacritty";
|
||||
TERMINAL = "alacritty";
|
||||
VISUAL = "nvim";
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
|
||||
file = {
|
||||
"${config.xdg.configHome}/nvim".source = lib.custom.relativeToRoot "dotfiles/nvim";
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
bottom
|
||||
lazygit
|
||||
discord
|
||||
eza
|
||||
ripgrep
|
||||
rm-improved
|
||||
dust
|
||||
gh
|
||||
zoxide
|
||||
xcp
|
||||
unzip
|
||||
prismlauncher
|
||||
tmux
|
||||
lazygit
|
||||
gcc
|
||||
zig
|
||||
protonmail-desktop
|
||||
protonvpn-gui
|
||||
cloudflare-warp
|
||||
kubectl
|
||||
gparted
|
||||
k9s
|
||||
gnupg
|
||||
postgresql_17
|
||||
dig
|
||||
bash
|
||||
dolphin
|
||||
font-awesome
|
||||
tree
|
||||
wl-clipboard-rs
|
||||
brightnessctl
|
||||
age
|
||||
nerd-fonts.jetbrains-mono
|
||||
obsidian
|
||||
];
|
||||
|
||||
nix = {
|
||||
package = lib.mkDefault pkgs.nix;
|
||||
settings = {
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
warn-dirty = false;
|
||||
};
|
||||
};
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# Nicely reload system units when changing configs
|
||||
systemd.user.startServices = "sd-switch";
|
||||
}
|
||||
8
home/shahab/common/core/direnv.nix
Normal file
8
home/shahab/common/core/direnv.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
}
|
||||
7
home/shahab/common/core/fonts.nix
Normal file
7
home/shahab/common/core/fonts.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
fonts.fontconfig.enable = true;
|
||||
home.packages = with pkgs; [
|
||||
nerd-fonts.jetbrains-mono
|
||||
];
|
||||
}
|
||||
34
home/shahab/common/core/git.nix
Normal file
34
home/shahab/common/core/git.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
programs.git = {
|
||||
package = pkgs.gitAndTools.gitFull;
|
||||
enable = true;
|
||||
userName = config.hostSpec.userFullName;
|
||||
userEmail = config.hostSpec.email.user;
|
||||
|
||||
extraConfig = {
|
||||
gpg = {
|
||||
format = "ssh";
|
||||
};
|
||||
"gpg \"ssh\"" = {
|
||||
program = "${lib.getExe' pkgs._1password-gui "op-ssh-sign"}";
|
||||
};
|
||||
commit = {
|
||||
gpgsign = true;
|
||||
};
|
||||
user = {
|
||||
signingKey = "~/.ssh/id_rihla.pub";
|
||||
};
|
||||
pull = {
|
||||
rebase = true;
|
||||
};
|
||||
init = {
|
||||
defaultBranch = "main";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home/shahab/common/optional/btop.nix
Normal file
7
home/shahab/common/optional/btop.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
programs.btop = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
11
home/shahab/common/optional/firefox.nix
Normal file
11
home/shahab/common/optional/firefox.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{pkgs, ...}: {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package = pkgs.firefox.override {
|
||||
cfg = {
|
||||
# Gnome shell native connector
|
||||
enableGnomeExtensions = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
27
home/shahab/common/optional/hyprland.nix
Normal file
27
home/shahab/common/optional/hyprland.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
home = {
|
||||
file = {
|
||||
"${config.xdg.configHome}/hypr".source = lib.custom.relativeToRoot "dotfiles/hypr";
|
||||
"${config.xdg.configHome}/waybar".source = lib.custom.relativeToRoot "dotfiles/waybar";
|
||||
"${config.xdg.configHome}/wofi".source = lib.custom.relativeToRoot "dotfiles/wofi";
|
||||
"${config.xdg.configHome}/mako".source = lib.custom.relativeToRoot "dotfiles/mako";
|
||||
};
|
||||
|
||||
packages = with pkgs; [
|
||||
hyprshot
|
||||
hyprlock
|
||||
hypridle
|
||||
hyprpolkitagent
|
||||
waybar
|
||||
wofi
|
||||
mako
|
||||
];
|
||||
};
|
||||
}
|
||||
43
home/shahab/common/optional/misc-packages.nix
Normal file
43
home/shahab/common/optional/misc-packages.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
nh
|
||||
bottom
|
||||
discord
|
||||
eza
|
||||
ripgrep
|
||||
rm-improved
|
||||
dust
|
||||
gh
|
||||
zoxide
|
||||
xcp
|
||||
unzip
|
||||
prismlauncher
|
||||
lazygit
|
||||
gcc
|
||||
zig
|
||||
protonmail-desktop
|
||||
protonvpn-gui
|
||||
cloudflare-warp
|
||||
kubectl
|
||||
gparted
|
||||
k9s
|
||||
gnupg
|
||||
postgresql_17
|
||||
dig
|
||||
bash
|
||||
kitty
|
||||
dolphin
|
||||
waybar
|
||||
font-awesome
|
||||
tree
|
||||
wl-clipboard-rs
|
||||
brightnessctl
|
||||
age
|
||||
obsidian
|
||||
];
|
||||
}
|
||||
12
home/shahab/common/optional/nvim.nix
Normal file
12
home/shahab/common/optional/nvim.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
};
|
||||
}
|
||||
8
home/shahab/common/optional/ssh.nix
Normal file
8
home/shahab/common/optional/ssh.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{...}: let
|
||||
onePassPath = "~/.1password/agent.sock";
|
||||
in {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
extraConfig = "IdentityAgent ${onePassPath}";
|
||||
};
|
||||
}
|
||||
3
home/shahab/common/optional/starship.nix
Normal file
3
home/shahab/common/optional/starship.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{...}: {
|
||||
programs.starship.enable = true;
|
||||
}
|
||||
18
home/shahab/common/optional/tmux.nix
Normal file
18
home/shahab/common/optional/tmux.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
home = {
|
||||
file = {
|
||||
"${config.xdg.configHome}/tmux".source = lib.custom.relativeToRoot "dotfiles/tmux";
|
||||
};
|
||||
|
||||
packages = with pkgs; [
|
||||
tmux
|
||||
];
|
||||
};
|
||||
}
|
||||
31
home/shahab/common/optional/zsh.nix
Normal file
31
home/shahab/common/optional/zsh.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{config, ...}: {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
initExtra = ''
|
||||
source <(nh completions --shell zsh)
|
||||
eval "$(zoxide init zsh)"
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
".." = "cd ..";
|
||||
ls = "exa";
|
||||
vim = "nvim";
|
||||
grep = "rg";
|
||||
du = "dust";
|
||||
rm = "rip";
|
||||
cp = "xcp";
|
||||
uo = "nh os switch ~/nix-config";
|
||||
uh = "nh home switch ~/nix-config";
|
||||
k = "kubectl";
|
||||
};
|
||||
|
||||
history = {
|
||||
size = 10000;
|
||||
path = "${config.xdg.dataHome}/zsh/history";
|
||||
};
|
||||
};
|
||||
}
|
||||
38
home/shahab/rihla.nix
Normal file
38
home/shahab/rihla.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = lib.flatten [
|
||||
#
|
||||
# ========== Required Configs ==========
|
||||
#
|
||||
./common/core
|
||||
|
||||
#
|
||||
# ========== Host-specific Optional Configs ==========
|
||||
#
|
||||
(map (config: "${builtins.toString ./.}/common/optional/${config}.nix") [
|
||||
"hyprland"
|
||||
"starship"
|
||||
"ssh"
|
||||
"zsh"
|
||||
"btop"
|
||||
"firefox"
|
||||
"nvim"
|
||||
"tmux"
|
||||
"misc-packages"
|
||||
])
|
||||
];
|
||||
|
||||
services.yubikey-touch-detector.enable = true;
|
||||
|
||||
home = {
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
stateVersion = "25.05";
|
||||
sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user