diff --git a/configuration.nix b/configuration.nix index 867a707b..d10cd5b1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -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 @@ -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 = { diff --git a/home-manager/git.nix b/home-manager/git.nix new file mode 100644 index 00000000..b372ee1d --- /dev/null +++ b/home-manager/git.nix @@ -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; + }; + }; +} \ No newline at end of file diff --git a/home.nix b/home.nix index 1b529003..1f0067bb 100644 --- a/home.nix +++ b/home.nix @@ -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 @@ -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 diff --git a/packages/global-packages.nix b/packages/global-packages.nix new file mode 100644 index 00000000..b1f35436 --- /dev/null +++ b/packages/global-packages.nix @@ -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; + }; +} \ No newline at end of file diff --git a/packages/user-packages.nix b/packages/user-packages.nix new file mode 100644 index 00000000..2a78a467 --- /dev/null +++ b/packages/user-packages.nix @@ -0,0 +1,85 @@ +# This config file is used to define user specific packages +# installed using home manager, this file is imported in ../home.nix +# System/Global packages should be installed in ./system-packages.nix +# Some packages/apps maybe handled by config options +# They are scattered in ../system/ ../home-manager/ and ../apps/ directories + +{ pkgs, pkgs-stable, ... }: +{ + 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-fresh + discord + telegram-desktop + deluge + ]) + + ++ + + (with pkgs-stable; [ + # list of latest packages from stable repo + # Can be used to downgrade packages + + ]) + ; +} \ No newline at end of file