update laptop configuration

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2025-07-16 20:14:43 +02:00
parent 72e4be86eb
commit 59ae3d5f9d
50 changed files with 479 additions and 1009 deletions

View File

@@ -1,87 +0,0 @@
{ pkgs, inputs, ... }: {
programs.anyrun = {
enable = true;
config = {
plugins = with inputs.anyrun.packages.${pkgs.system}; [
applications
shell
randr
rink
symbols
translate
];
width.fraction = 0.25;
y.fraction = 0.3;
hidePluginInfo = true;
closeOnClick = true;
};
extraCss = ''
* {
all: unset;
font-size: 1.2rem;
}
#window,
#match,
#entry,
#plugin,
#main {
background: transparent;
}
#match.activatable {
border-radius: 8px;
margin: 4px 0;
padding: 4px;
/* transition: 100ms ease-out; */
}
#match.activatable:first-child {
margin-top: 12px;
}
#match.activatable:last-child {
margin-bottom: 0;
}
#match:hover {
background: rgba(255, 255, 255, 0.05);
}
#match:selected {
background: rgba(255, 255, 255, 0.1);
}
#entry {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
padding: 4px 8px;
}
box#main {
background: rgba(0, 0, 0, 0.5);
box-shadow:
inset 0 0 0 1px rgba(255, 255, 255, 0.1),
0 30px 30px 15px rgba(0, 0, 0, 0.5);
border-radius: 20px;
padding: 12px;
}
'';
extraConfigFiles = {
"applications.ron".text = ''
Config(
desktop_actions: false,
max_entries: 5,
terminal: Some("foot"),
)
'';
"shell.ron".text = ''
Config(
prefix: ">"
)
'';
};
};
}

View File

@@ -1,9 +1,9 @@
# Discord is a popular chat application.
{ inputs, ... }: {
imports = [ inputs.nixcord.homeModules.nixcord ];
{inputs, ...}: {
imports = [inputs.nixcord.homeModules.nixcord];
programs.nixcord = {
enable = true;
config = { frameless = true; };
config = {frameless = true;};
};
}

View File

@@ -1,6 +1,5 @@
# A duckduckgo colorscheme generated for the Stylix theme used.
{ config, ... }:
let
{config, ...}: let
accent = config.lib.stylix.colors.base0D;
background = config.lib.stylix.colors.base00;
foreground = config.lib.stylix.colors.base05;

View File

@@ -1 +1,2 @@
{ imports = [ ./neofetch ./nerdfetch ]; }
# Import all fetch scripts
{imports = [./neofetch ./nerdfetch];}

View File

@@ -1,6 +1,6 @@
# Legacy
{ pkgs, ... }: {
home.packages = with pkgs; [ neofetch ];
{pkgs, ...}: {
home.packages = with pkgs; [neofetch];
xdg.configFile."neofetch/ascii.txt".text = ''
''${c6}
@@ -28,7 +28,7 @@
xdg.configFile."neofetch/config.conf".text = ''
# From: https://github.com/Chick2D/neofetch-themes/
# Made by https://github.com/Dan1jel
# Made by https://github.com/Dan1jel
print_info() {
prin "\n"

View File

@@ -1,7 +1,6 @@
# Nerdfetch, a simple system info script written in bash
# Source: https://github.com/ThatOneCalculator/NerdFetch
{ pkgs, ... }:
let
{pkgs, ...}: let
nerdfetch = pkgs.writeShellScriptBin "nerdfetch" ''
ostype="$(uname)"
@@ -197,9 +196,7 @@ let
flatpak) packages="$(flatpak list --app | wc -l)" ;;
brew) packages="$(printf '%s\n' "$(brew --cellar)/"* | wc -l)" ;;
port) packages="$(port installed | wc -l)" ;;
dpkg-query) packages="$(dpkg-query -f '${
"binary:Package"
}\n' -W | wc -l)" ;;
dpkg-query) packages="$(dpkg-query -f '${"binary:Package"}\n' -W | wc -l)" ;;
rpm) packages="$(rpm -qa --last | wc -l)" ;;
yum) packages="$(yum list installed | wc -l)" ;;
dnf) packages="$(dnf list installed | wc -l)" ;;
@@ -358,7 +355,7 @@ let
## OUTPUT
echo """
''${c0} ___ ''${nc}''${USER}''${grey}@''${reset}''${hn}''${host}''${reset}
''${c0} ___ ''${nc}''${USER}''${grey}@''${reset}''${hn}''${host}''${reset}
''${c0} (''${c1}.. ''${c0}\ ''${lc}''${osi} ''${ic}''${os}''${reset}
''${c0} (''${c2}<> ''${c0}| ''${lc}''${ki} ''${ic}''${kernel}''${reset}
''${c0} /''${c1}/ \\ ''${c0}\\ ''${lc}''${ri} ''${ic}''${RAM}''${memstat} ''${mempercent}
@@ -367,5 +364,4 @@ let
''${c2} \/''${c0}-____''${c2}\/''${reset} ''${lc}''${ci} ''${red}''${green}''${yellow}''${blue}''${magenta}''${cyan}''${reset}
"""
'';
in { home.packages = [ nerdfetch ]; }
in {home.packages = [nerdfetch];}

View File

@@ -1,6 +1,5 @@
# Git configuration
{ config, ... }:
let
{config, ...}: let
username = config.var.git.username;
email = config.var.git.email;
in {
@@ -50,8 +49,7 @@ in {
log --pretty=format:"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)" --graph --date=relative --decorate --all'';
llog = ''
log --graph --name-status --pretty=format:"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset" --date=relative'';
edit-unmerged =
"!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; hx `f`";
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; hx `f`";
};
};
}

View File

@@ -1,6 +1,8 @@
_: {
home.file.".ssh/allowed_signers".text =
"* ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIINhWby7lUUXQNKbRu9/UOrGjWDf3fvoAwGHomWv/+lL";
# This file is used to sign git commits using an SSH key.
{
# Obviously, change this to your own SSH key.
home.file.".ssh/allowed_signers".text = "* ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIINhWby7lUUXQNKbRu9/UOrGjWDf3fvoAwGHomWv/+lL";
programs.git.extraConfig = {
commit.gpgsign = true;
gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers";

View File

@@ -1,6 +1,9 @@
# Lazygit is a simple terminal UI for git commands.
{ config, lib, ... }:
let
{
config,
lib,
...
}: let
accent = "#${config.lib.stylix.colors.base0D}";
muted = "#${config.lib.stylix.colors.base03}";
in {
@@ -17,8 +20,8 @@ in {
};
gui = {
theme = {
activeBorderColor = [ accent "bold" ];
inactiveBorderColor = [ muted ];
activeBorderColor = [accent "bold"];
inactiveBorderColor = [muted];
};
showListFooter = false;
showRandomTip = false;

View File

@@ -1,4 +1,5 @@
# Nextcloud is a suite of client-server software for creating file hosting services and using them. It is functionally similar to Dropbox, although Nextcloud is free and open-source, allowing anyone to install and operate it on a private server. In contrast to proprietary services, Nextcloud can be hosted on a private server, without additional cost.
# This is the client, check /server-modules/nextcloud.nix for the server module.
{
services.nextcloud-client = {
enable = true;

View File

@@ -1,3 +1,4 @@
# NVF is a Neovim configuration that provides a minimal setup with essential plugins and configurations.
{
inputs,
pkgs,

View File

@@ -1,7 +1,11 @@
# Qutebrowser is a keyboard-focused browser with a minimal GUI.
# My homepage is generated using https://github.com/anotherhadi/homepage
{ pkgs, config, ... }:
let
# Legacy
{
pkgs,
config,
...
}: let
accent = "#${config.lib.stylix.colors.base0D}";
background = "#${config.lib.stylix.colors.base00}";
foreground = "#${config.lib.stylix.colors.base05}";
@@ -77,10 +81,8 @@ let
homepage = "https://github.com/anotherhadi/homepage";
};
};
in {
imports = [ ../duckduckgo-colorscheme ];
imports = [../duckduckgo-colorscheme];
programs.qutebrowser = {
enable = true;
@@ -120,19 +122,18 @@ in {
settings = {
url = {
default_page = "${homepage}/build/index.html";
start_pages = [ "${homepage}/build/index.html" ];
start_pages = ["${homepage}/build/index.html"];
};
colors = {
webpage.preferred_color_scheme =
"dark"; # Enable dark mode for websites that support it
webpage.preferred_color_scheme = "dark"; # Enable dark mode for websites that support it
};
statusbar.show = "in-mode";
completion = {
height = "30%";
open_categories = [ "history" ];
open_categories = ["history"];
scrollbar = {
padding = 0;
width = 0;
@@ -156,7 +157,7 @@ in {
remove_finished = 0;
};
hints = { radius = 1; };
hints = {radius = 1;};
scrolling = {
bar = "never";

View File

@@ -1,4 +1,4 @@
# Import all shell configurations
{
imports =
[ ./fzf.nix ./zsh.nix ./starship.nix ./zoxide.nix ./tmux.nix ./eza.nix ];
imports = [./fzf.nix ./zsh.nix ./starship.nix ./zoxide.nix ./eza.nix];
}

View File

@@ -1,6 +1,9 @@
# Fzf is a general-purpose command-line fuzzy finder.
{ config, lib, ... }:
let
{
config,
lib,
...
}: let
accent = "#" + config.lib.stylix.colors.base0D;
foreground = "#" + config.lib.stylix.colors.base05;
muted = "#" + config.lib.stylix.colors.base03;

View File

@@ -1,6 +1,9 @@
# starship is a minimal, fast, and extremely customizable prompt for any shell!
{ config, lib, ... }:
let
{
config,
lib,
...
}: let
accent = "#${config.lib.stylix.colors.base0D}";
background-alt = "#${config.lib.stylix.colors.base01}";
in {
@@ -17,7 +20,7 @@ in {
"$git_status"
"$character"
];
directory = { style = accent; };
directory = {style = accent;};
character = {
success_symbol = "[](${accent})";
@@ -38,8 +41,7 @@ in {
};
git_status = {
format =
"[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218)($ahead_behind$stashed)]($style)";
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218)($ahead_behind$stashed)]($style)";
style = "cyan";
conflicted = "";
renamed = "";

View File

@@ -1,58 +0,0 @@
# Tmux is a terminal multiplexer that allows you to run multiple terminal sessions in a single window.
{ pkgs, ... }:
let
Config = pkgs.writeShellScriptBin "Config" ''
SESSION="Nixy Config"
tmux has-session -t "$SESSION" 2>/dev/null
if [ $? == 0 ]; then
tmux attach -t "$SESSION"
exit 0
fi
tmux new-session -d -s "$SESSION"
tmux send-keys -t "$SESSION" "sleep 0.2 && clear && cd ~/.config/nixos/ && vim" C-m
tmux new-window -t "$SESSION" -n "nixy"
tmux send-keys -t "$SESSION":1 "sleep 0.2 && clear && cd ~/.config/nixos/ && nixy loop" C-m
tmux new-window -t "$SESSION" -n "lazygit"
tmux send-keys -t "$SESSION":2 "sleep 0.2 && clear && cd ~/.config/nixos/ && lazygit" C-m
tmux select-window -t "$SESSION":0
tmux select-pane -t 0
tmux attach -t "$SESSION"
'';
in {
programs.tmux = {
enable = true;
mouse = true;
shell = "${pkgs.zsh}/bin/zsh";
prefix = "C-s";
terminal = "kitty";
keyMode = "vi";
extraConfig = ''
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
set -gq allow-passthrough on
bind-key x kill-pane # skip "kill-pane 1? (y/n)" prompt
bind-key -n C-Tab next-window
bind-key -n C-S-Tab previous-window
bind-key -n M-Tab new-window
'';
plugins = with pkgs; [
tmuxPlugins.vim-tmux-navigator
# tmuxPlugins.resurrect
tmuxPlugins.sensible
tmuxPlugins.tokyo-night-tmux
];
};
home.packages = [ Config ];
}

View File

@@ -1,11 +1,16 @@
# My shell configuration
{ pkgs, lib, config, ... }:
let fetch = config.theme.fetch; # neofetch, nerdfetch, pfetch
{
pkgs,
lib,
config,
...
}: let
fetch = config.theme.fetch; # neofetch, nerdfetch, pfetch
in {
home.packages = with pkgs; [bat ripgrep tldr sesh rmtrash trash-cli];
home.packages = with pkgs; [ bat ripgrep tldr sesh rmtrash trash-cli ];
home.sessionPath = [ "$HOME/go/bin" ];
# Add go binaries to the PATH
home.sessionPath = ["$HOME/go/bin"];
programs.zsh = {
enable = true;
@@ -13,7 +18,7 @@ in {
autosuggestion.enable = true;
syntaxHighlighting = {
enable = true;
highlighters = [ "main" "brackets" "pattern" "regexp" "root" "line" ];
highlighters = ["main" "brackets" "pattern" "regexp" "root" "line"];
};
historySubstringSearch.enable = true;
@@ -23,7 +28,7 @@ in {
size = 10000;
};
profileExtra = lib.optionalString (config.home.sessionPath != [ ]) ''
profileExtra = lib.optionalString (config.home.sessionPath != []) ''
export PATH="$PATH''${PATH:+:}${
lib.concatStringsSep ":" config.home.sessionPath
}"
@@ -43,18 +48,15 @@ in {
sl = "ls";
open = "${pkgs.xdg-utils}/bin/xdg-open";
icat = "${pkgs.kitty}/bin/kitty +kitten icat";
cat =
"bat --theme=base16 --color=always --paging=never --tabs=2 --wrap=never --plain";
cat = "bat --theme=base16 --color=always --paging=never --tabs=2 --wrap=never --plain";
mkdir = "mkdir -p";
rm = "${pkgs.rmtrash}/bin/rmtrash";
rmdir = "${pkgs.rmtrash}/bin/rmdirtrash";
obsidian-no-gpu =
"env ELECTRON_OZONE_PLATFORM_HINT=auto obsidian --ozone-platform=x11";
obsidian-no-gpu = "env ELECTRON_OZONE_PLATFORM_HINT=auto obsidian --ozone-platform=x11";
wireguard-import = "nmcli connection import type wireguard file";
notes =
"nvim ~/nextcloud/notes/index.md --cmd 'cd ~/nextcloud/notes' -c ':lua Snacks.picker.smart()'";
notes = "nvim ~/nextcloud/notes/index.md --cmd 'cd ~/nextcloud/notes' -c ':lua Snacks.picker.smart()'";
note = "notes";
tmp = "nvim /tmp/$(date | sed 's/ //g;s/\\.//g').md";
@@ -79,17 +81,19 @@ in {
gcm = "git commit -m";
};
initContent = # bash
initContent =
# bash
''
bindkey -e
${if fetch == "neofetch" then
pkgs.neofetch + "/bin/neofetch"
else if fetch == "nerdfetch" then
"nerdfetch"
else if fetch == "pfetch" then
"echo; ${pkgs.pfetch}/bin/pfetch"
else
""}
${
if fetch == "neofetch"
then pkgs.neofetch + "/bin/neofetch"
else if fetch == "nerdfetch"
then "nerdfetch"
else if fetch == "pfetch"
then "echo; ${pkgs.pfetch}/bin/pfetch"
else ""
}
function sesh-sessions() {
session=$(sesh list -t -c | fzf --height 70% --reverse)

View File

@@ -1,11 +1,16 @@
# Spicetify is a spotify client customizer
{ pkgs, config, lib, inputs, ... }:
let
{
pkgs,
config,
lib,
inputs,
...
}: let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
accent = "${config.lib.stylix.colors.base0D}";
background = "${config.lib.stylix.colors.base00}";
in {
imports = [ inputs.spicetify-nix.homeManagerModules.default ];
imports = [inputs.spicetify-nix.homeManagerModules.default];
stylix.targets.spicetify.enable = false;

View File

@@ -1,8 +1,7 @@
# Tailscale is a VPN service that works on top of WireGuard.
# It allows me to access my servers and devices from anywhere.
{ pkgs, ... }: {
home.packages = with pkgs; [ tailscale tailscale-systray ];
{pkgs, ...}: {
home.packages = with pkgs; [tailscale tailscale-systray];
wayland.windowManager.hyprland.settings.exec-once =
[ "${pkgs.tailscale-systray}/bin/tailscale-systray" ];
wayland.windowManager.hyprland.settings.exec-once = ["${pkgs.tailscale-systray}/bin/tailscale-systray"];
}

View File

@@ -1,6 +1,10 @@
# Thunar is a file explorer
{ pkgs, config, ... }:
let user = config.var.username;
{
pkgs,
config,
...
}: let
user = config.var.username;
in {
# ctrl + m to toggle the menubar
home.packages = with pkgs; [

View File

@@ -1,9 +1,5 @@
# Zen is a minimalistic web browser.
{
pkgs,
inputs,
...
}: {
{inputs, ...}: {
imports = [
inputs.zen-browser.homeModules.beta
];