Universe/users/lxsameer/desktop.nix

339 lines
9.0 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Universe - The big bang to my universe
#
# Copyright (c) 2023-2024 Sameer Rahmani <lxsameer@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{ config, pkgs, ... }@params:
{
home.username = "lxsameer";
home.homeDirectory = "/home/lxsameer";
# link the configuration file in current directory to the specified location in home directory
# home.file.".config/i3/wallpaper.jpg".source = ./wallpaper.jpg;
# link all files in `./scripts` to `~/.config/i3/scripts`
# home.file.".config/i3/scripts" = {
# source = ./scripts;
# recursive = true; # link recursively
# executable = true; # make all files executable
# };
# encode the file content in nix configuration file directly
# home.file.".xxx".text = ''
# xxx
# '';
# This is a hack to make fg42/home-manager/startx co-operate
home.file.".xinitrc".text = ''
xset b off
xsetroot -solid black &
exec $HOME/.fg42-xsession
'';
home.file.".fg42.el".source = ./fg42.el;
# set cursor size and dpi for 4k monitor
xresources.properties = {
"Xcursor.size" = 16;
"Xft.dpi" = 96;
"Xft.autohint" = 0;
"Xft.lcdfilter" = "lcddefault";
"Xft.hintstyle" = "hintfull";
"Xft.hinting" = 1;
"Xft.antialias" = 1;
# Xft.rgba: rgb
};
fonts.fontconfig.enable = true;
home.extraOutputsToInstall = [ "man" ];
# Packages that should be installed to the user profile.
home.packages = with pkgs; [
params.fg42
# archives
zip
xz
unzip
# browsers
librewolf
firefox
# utils
ripgrep
eza # A modern replacement for ls
fzf # A command-line fuzzy finder
# networking tools
mtr # A network diagnostic tool
iperf3 # A TCP, UDP, and SCTP network bandwidth measurement tool
dnsutils # `dig` + `nslookup`
ldns # replacement of `dig`, it provide the command `drill`
aria2 # A lightweight multi-protocol & multi-source command-line download utility
socat # replacement of openbsd-netcat
nmap # A utility for network discovery and security auditing
# misc
file
which
tree
gnused
gnutar
gawk
zstd
gnupg
libnotify
# nix related
#
# it provides the command `nom` works just like `nix`
# with more details log output
nix-output-monitor
nix-tree
nix-index
# productivity
btop # replacement of htop/nmon
iotop # io monitoring
iftop # network monitoring
# system call monitoring
strace # system call monitoring
ltrace # library call monitoring
lsof # list open files
# system tools
sysstat
lm_sensors # for `sensors` command
ethtool
pciutils
usbutils
vazir-fonts
fira-code
nerdfonts
thefuck
yubioath-flutter
];
# basic configuration of git, please change to your own
programs.git = {
enable = true;
package = pkgs.gitFull;
userName = "Sameer Rahmani";
userEmail = "lxsameer@gnu.org";
aliases = {
co = "checkout";
br = "branch";
ci = "commit";
st = "status";
unstage = "reset HEAD --";
last = "log -1 HEAD";
lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
brs = "for-each-ref --sort='-authordate:iso8601' --count 20 --format=' %(color:green)%(authordate:relative)%09%(if)%(HEAD)%(then)%(color:brightwhite)*%(else)%(color:white) %(end)%(refname:short)%09%(color:yellow)%(authorname)%(authoremail)' refs/heads";
};
signing = {
key = "6F3FA93B4BD9C3CAEF3877E6384A12C310233CC5";
signByDefault = true;
};
difftastic.enable = true;
# delta.enable = true;
extraConfig = {
core = {
abbrev = 12;
excludesFile = "${./git/gitignore}";
};
pretty = {
fixes = "Fixes: %h (\"%s\")";
};
url."git@github.com:" = {
insteadOf = "https://github.com/";
};
sendemail = {
smtpEncryption = "tls";
smtpServer = "fencepost.gnu.org";
smtpUser = "lxsameer";
smtpServerPort = 587;
};
status.submoduleSummary = true;
pull.rebase = false;
http.sslVerify = true;
};
};
# starship - an customizable prompt for any shell
programs.starship = {
enable = true;
# custom settings
settings = {
add_newline = true;
aws.disabled = true;
gcloud.disabled = true;
line_break.disabled = true;
};
};
# alacritty - a cross-platform, GPU-accelerated terminal emulator
programs.alacritty = {
enable = true;
# custom settings
settings = {
env.TERM = "xterm-256color";
font = {
size = 10;
draw_bold_text_with_bright_colors = true;
};
scrolling.multiplier = 5;
selection.save_to_clipboard = true;
};
};
programs.zsh = {
enable = true;
autocd = true;
# dotDir = ".config/zsh";
enableAutosuggestions = true;
enableCompletion = true;
shellAliases = {
sl = "exa";
ls = "exa";
l = "exa -l";
la = "exa -la";
ip = "ip --color=auto";
g = "git";
d = "docker";
n = "nix";
ew = "emacs -nw";
_ = "sudo";
};
initExtra = ''
bindkey '^ ' autosuggest-accept
AGKOZAK_CMD_EXEC_TIME=5
AGKOZAK_COLORS_CMD_EXEC_TIME='yellow'
AGKOZAK_COLORS_PROMPT_CHAR='magenta'
AGKOZAK_CUSTOM_SYMBOLS=( '' '' '' '+' 'x' '!' '>' '?' )
AGKOZAK_MULTILINE=0
AGKOZAK_PROMPT_CHAR=( )
eval $(thefuck --alias)
autopair-init
'';
plugins = with pkgs; [
{
name = "agkozak-zsh-prompt";
src = fetchFromGitHub {
owner = "agkozak";
repo = "agkozak-zsh-prompt";
rev = "v3.7.0";
sha256 = "1iz4l8777i52gfynzpf6yybrmics8g4i3f1xs3rqsr40bb89igrs";
};
file = "agkozak-zsh-prompt.plugin.zsh";
}
{
name = "formarks";
src = fetchFromGitHub {
owner = "wfxr";
repo = "formarks";
rev = "8abce138218a8e6acd3c8ad2dd52550198625944";
sha256 = "1wr4ypv2b6a2w9qsia29mb36xf98zjzhp3bq4ix6r3cmra3xij90";
};
file = "formarks.plugin.zsh";
}
{
name = "zsh-syntax-highlighting";
src = fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.6.0";
sha256 = "0zmq66dzasmr5pwribyh4kbkk23jxbpdw4rjxx0i7dx8jjp2lzl4";
};
file = "zsh-syntax-highlighting.zsh";
}
{
name = "zsh-abbrev-alias";
src = fetchFromGitHub {
owner = "momo-lab";
repo = "zsh-abbrev-alias";
rev = "637f0b2dda6d392bf710190ee472a48a20766c07";
sha256 = "16saanmwpp634yc8jfdxig0ivm1gvcgpif937gbdxf0csc6vh47k";
};
file = "abbrev-alias.plugin.zsh";
}
{
name = "zsh-autopair";
src = fetchFromGitHub {
owner = "hlissner";
repo = "zsh-autopair";
rev = "34a8bca0c18fcf3ab1561caef9790abffc1d3d49";
sha256 = "1h0vm2dgrmb8i2pvsgis3lshc5b0ad846836m62y8h3rdb3zmpy1";
};
file = "autopair.zsh";
}
];
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.mpv.enable = true;
programs.obs-studio.enable = true;
programs.noti.enable = true;
# Let home Manager install and manage itself.
programs.home-manager.enable = true;
# This value determines the home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new home Manager release introduces backwards
# incompatible changes.
#
# You can update home Manager without changing this value. See
# the home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "24.05";
home.sessionVariables.XMODIFIERS = "@im=exim";
home.sessionVariables.GTK_IM_MODULE = "xim";
home.sessionVariables.QT_IM_MODULE = "xim";
home.sessionVariables.CLUTTER_IM_MODULE = "xim";
xsession.enable = true;
xsession.profileExtra = ''
export XMODIFIERS=@im=exwm-xim
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim
export CLUTTER_IM_MODULE=xim
systemctl --user import-environment XMODIFIERS GTK_IM_MODULE QT_IM_MODULE CLUTTER_IM_MODULE
'';
xsession.scriptPath = ".fg42-xsession";
xsession.windowManager.command = "${params.fg42}/bin/fg42-wm";
services.dunst.enable = true;
services.pasystray.enable = true;
services.network-manager-applet.enable = true;
services.gpg-agent = {
enable = true;
enableSshSupport = true;
};
}