feat: Flake | revamp entire flake (#1)

Reviewed-on: #1
This commit is contained in:
2025-02-16 06:35:32 +00:00
parent ecc87ef0b8
commit 79d044e8ef
80 changed files with 1015 additions and 174 deletions

View 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;
};
};
}

View 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";
}

View File

@@ -0,0 +1,8 @@
{
programs.direnv = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
}

View File

@@ -0,0 +1,7 @@
{ pkgs, ... }:
{
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
nerd-fonts.jetbrains-mono
];
}

View 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";
};
};
};
}

View File

@@ -0,0 +1,7 @@
{ ... }:
{
programs.btop = {
enable = true;
};
}

View File

@@ -0,0 +1,11 @@
{pkgs, ...}: {
programs.firefox = {
enable = true;
package = pkgs.firefox.override {
cfg = {
# Gnome shell native connector
enableGnomeExtensions = true;
};
};
};
}

View 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
];
};
}

View 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
];
}

View File

@@ -0,0 +1,12 @@
{
...
}:
{
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
}

View File

@@ -0,0 +1,8 @@
{...}: let
onePassPath = "~/.1password/agent.sock";
in {
programs.ssh = {
enable = true;
extraConfig = "IdentityAgent ${onePassPath}";
};
}

View File

@@ -0,0 +1,3 @@
{...}: {
programs.starship.enable = true;
}

View File

@@ -0,0 +1,18 @@
{
config,
lib,
pkgs,
...
}:
{
home = {
file = {
"${config.xdg.configHome}/tmux".source = lib.custom.relativeToRoot "dotfiles/tmux";
};
packages = with pkgs; [
tmux
];
};
}

View 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
View 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";
};
};
}