Skip to content

Commit

Permalink
Modularize git config, packages configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRTitor committed Mar 16, 2024
1 parent 9255028 commit 031061a
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 166 deletions.
83 changes: 3 additions & 80 deletions configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
# include power plan settings
./system/power.nix

# include global/system packages list
./packages/global-packages.nix

# include APPS settings
./apps/openrgb.nix
#./apps/kde-connect.nix
Expand Down Expand Up @@ -59,86 +62,6 @@

# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages =
(with pkgs; [

# System Packages
ananicy-cpp # for better system performance
baobab # disk usage analyzer
# cpufrequtils
# firewalld
ffmpeg # codecs
fuseiso # to mount iso system images
git # obviously
glib # for gsettings to work
gnupg # for encryption and auth keys
libappindicator
libnotify
linux-wifi-hotspot # for wifi hotspot
openssh # for ssh
python3
# pipewire # enabled via service
udiskie # automount usb drives
zip
unzip
# wireplumber # enabled via service

## BROWSERS ##

# firefox, chrome from unstable are incompatible with stable
(google-chrome.override {
# enable video encoding and hardware acceleration, along with several
# suitable for my configuration
# change it if you have any issues
# note the spaces, they are required
# Vulkan is not stable, likely because of drivers
commandLineArgs = ""
+ " --enable-accelerated-video-decode"
+ " --enable-accelerated-mjpeg-decode"
+ " --enable-gpu-compositing"
+ " --enable-gpu-rasterization" # dont enable in about:flags
+ " --enable-native-gpu-memory-buffers"
+ " --enable-raw-draw"
+ " --enable-zero-copy" # dont enable in about:flags
+ " --ignore-gpu-blocklist" # dont enable in about:flags
# + " --use-vulkan"
+ " --enable-features="
+ "VaapiVideoEncoder,"
+ "CanvasOopRasterization,"
# + "Vulkan"
;
})

## URL FETCH TOOLS ##
curl
wget

## EDITOR ##
vim
vscode

## MONITORING TOOLS ##
btop # for CPU, RAM, and Disk monitoring
nvtop-amd # for AMD GPUs
iotop # for disk I/O monitoring
iftop # for network I/O monitoring
])

++

(with pkgs-stable; [
# list of latest packages from stable repo
# Can be used to downgrade packages

]);

# Enable Firefox Wayland
programs.firefox = {
enable = true;
package = pkgs.firefox-wayland;
};

# SECURITY
security = {
Expand Down
20 changes: 20 additions & 0 deletions home-manager/git.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ userSettings, ... }:
{
# basic configuration of git, please change to your own
programs.git = {
enable = true;
userName = userSettings.gitname;
userEmail = userSettings.gitemail;
signing.key = userSettings.gpgkey;
signing.signByDefault = true;
# compare diff using syntax
difftastic.enable = true;
extraConfig = {
color.ui = true;
# verbose messages
commit.verbose = true;
# always rebase when pulling
pull.rebase = true;
};
};
}
88 changes: 2 additions & 86 deletions home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
home.homeDirectory = "/home/"+userSettings.username;

imports = [
./packages/user-packages.nix # user specific packages
./home-manager/shell.nix # shell (bash, zsh) config
./home-manager/git.nix # git config
./home-manager/starship/starship.nix # starship config
./home-manager/alacritty/alacritty.nix
./home-manager/pyprland/pyprland.nix # pyprland config wrapper
Expand Down Expand Up @@ -42,92 +44,6 @@
"Xft.dpi" = 96; # for 4k - 172
};

# Packages that should be installed to the user profile.
home.packages = with pkgs; [
# here is some command line tools I use frequently
# feel free to add your own or remove some of them

# editors
# vscode
# emacs

nnn # terminal file manager

# archives
# zip
xz
# unzip
p7zip

# utils
ripgrep # recursively searches directories for a regex pattern
jq # A lightweight and flexible command-line JSON processor
yq-go # yaml processer https://github.com/mikefarah/yq
# eza # A modern replacement for ‘ls’
fzf # A command-line fuzzy finder

# networking tools
mtr # A network diagnostic tool
iperf3
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
ipcalc # it is a calculator for the IPv4/v6 addresses

# misc
cowsay
file
which
tree
gnused
gnutar
gawk
zstd

# productivity
hugo # static site generator
glow # markdown previewer in terminal

# 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 # lspci
usbutils # lsusb

# graphical apps
# whatsapp-for-linux
libreoffice
discord
telegram-desktop
deluge
];

# basic configuration of git, please change to your own
programs.git = {
enable = true;
userName = userSettings.gitname;
userEmail = userSettings.gitemail;
signing.key = userSettings.gpgkey;
signing.signByDefault = true;
# compare diff using syntax
difftastic.enable = true;
extraConfig = {
color.ui = true;
# verbose messages
commit.verbose = true;
# always rebase when pulling
pull.rebase = 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
Expand Down
90 changes: 90 additions & 0 deletions packages/global-packages.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# This config file is used to define system/global packages
# this file is imported ../configuration.nix
# User specific packages should be installed in ./user-packages.nix
# Some packages/apps maybe handled by config options
# They are scattered in ../system/ ../home-manager/ and ../apps/ directories

{ pkgs, pkgs-stable, ... }:
{
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages =
(with pkgs; [

# System Packages
ananicy-cpp # for better system performance
baobab # disk usage analyzer
# cpufrequtils
# firewalld
ffmpeg # codecs
fuseiso # to mount iso system images
git # obviously
glib # for gsettings to work
gnupg # for encryption and auth keys
libappindicator
libnotify
linux-wifi-hotspot # for wifi hotspot
openssh # for ssh
python3
# pipewire # enabled via service
udiskie # automount usb drives
zip
unzip
# wireplumber # enabled via service

## BROWSERS ##

# firefox, chrome from unstable are incompatible with stable
(google-chrome.override {
# enable video encoding and hardware acceleration, along with several
# suitable for my configuration
# change it if you have any issues
# note the spaces, they are required
# Vulkan is not stable, likely because of drivers
commandLineArgs = ""
+ " --enable-accelerated-video-decode"
+ " --enable-accelerated-mjpeg-decode"
+ " --enable-gpu-compositing"
+ " --enable-gpu-rasterization" # dont enable in about:flags
+ " --enable-native-gpu-memory-buffers"
+ " --enable-raw-draw"
+ " --enable-zero-copy" # dont enable in about:flags
+ " --ignore-gpu-blocklist" # dont enable in about:flags
# + " --use-vulkan"
+ " --enable-features="
+ "VaapiVideoEncoder,"
+ "CanvasOopRasterization,"
# + "Vulkan"
;
})

## URL FETCH TOOLS ##
curl
wget

## EDITOR ##
vim
vscode

## MONITORING TOOLS ##
btop # for CPU, RAM, and Disk monitoring
nvtop-amd # for AMD GPUs
iotop # for disk I/O monitoring
iftop # for network I/O monitoring
])

++

(with pkgs-stable; [
# list of latest packages from stable repo
# Can be used to downgrade packages

])
;

# Enable Firefox Wayland
programs.firefox = {
enable = true;
package = pkgs.firefox-wayland;
};
}
Loading

0 comments on commit 031061a

Please sign in to comment.