From feb65868cc2a2710a99135e3e51621dc2a24753e Mon Sep 17 00:00:00 2001 From: Cookiez Date: Thu, 18 Dec 2025 14:20:16 +0100 Subject: [PATCH] Restructured nixos code for better structure. Commented what each package is for. --- modules/configuration.nix | 242 +++++++++++++++----------------- modules/firefox.nix | 1 + modules/home.nix | 2 +- modules/packages/cli.nix | 17 +-- modules/packages/desktop.nix | 72 +++++----- modules/packages/essentials.nix | 35 +++-- modules/stylix/default.nix | 2 +- plasma/autostart.nix | 2 +- plasma/plasma.nix | 58 +++----- 9 files changed, 199 insertions(+), 232 deletions(-) diff --git a/modules/configuration.nix b/modules/configuration.nix index d84fe5b..c14b5d3 100644 --- a/modules/configuration.nix +++ b/modules/configuration.nix @@ -1,18 +1,11 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - #Access Internet using: #nmcli device wifi list #nmcli device wifi connect password # or if no password (open wifi) #nmcli device wifi connect -#Nix flake file limit: ulimit -n 500000 - { inputs, config, pkgs, lib, username, project, host, version, system, ... }: { -# in configuration.nix #Assign Swap to the PC #swapDevices = [{ # device = "/swapfile"; @@ -20,19 +13,18 @@ #}]; imports = - [ - inputs.home-manager.nixosModules.home-manager - inputs.grub2-themes.nixosModules.default - inputs.nix-flatpak.nixosModules.nix-flatpak - ./hardware-configuration.nix + [ + inputs.home-manager.nixosModules.home-manager + inputs.grub2-themes.nixosModules.default + inputs.nix-flatpak.nixosModules.nix-flatpak + ./hardware-configuration.nix - ./firefox.nix - ./boot-splash.nix - ./zsh.nix - ./neovim.nix - ./packages - #./portainer.nix - ]; + ./firefox.nix + ./boot-splash.nix + ./zsh.nix + ./neovim.nix + ./packages + ]; # Bootloader. boot = { @@ -50,15 +42,8 @@ efiSupport = true; useOSProber = true; configurationLimit = 5; - #splashImage = - # extraConfig = '' - # menuentry "NixOS - Default" { - # set hidden=1 - # } - # ''; }; - grub2-theme = { enable = true; theme = "whitesur"; @@ -74,13 +59,29 @@ #Apply #Manage flags -> Add bios_grub - networking.hostName = host; - # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking = { + + # Enable networking + networkmanager.enable = true; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + extraHosts = '' + 100.89.141.79 tail-rpi + ''; + + hostName = host; + # Define your hostname. + # wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # proxy.default = "http://user:password@proxy:port/"; + # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Open ports in the firewall. + # firewall.allowedTCPPorts = [ ... ]; + # firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # firewall.enable = false; + }; home-manager = { useGlobalPkgs = true; @@ -91,13 +92,6 @@ sharedModules = [ inputs.plasma-manager.homeModules.plasma-manager ]; }; - # Enable networking - networking.networkmanager.enable = true; - - networking.extraHosts = '' - 100.89.141.79 tail-rpi - ''; - # Set your time zone. time.timeZone = "Europe/Berlin"; @@ -143,6 +137,31 @@ "--accept-routes" ]; }; + + # security.rtkit.enable = true; + pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + #jack.enable = true; + }; + + pipewire.wireplumber = { + enable = true; + extraConfig = { + "10-bluez-monitor.properties" = { + "bluez5.msbc-support" = false; + "bluez5.hfphsp-support" = false; + "bluez5.hfphsp-backend" = "none"; # Key addition: no backend + "bluez5.roles" = [ "a2dp_sink" ]; + }; + "11-bluetooth-policy" = { + "wireplumber.settings" = { + "bluetooth.autoswitch-to-headset-profile" = false; + }; + }; + }; + }; #Enable CUPS to print documents. printing.enable = true; @@ -173,80 +192,56 @@ }; }; - - #In order for dynamically linked executables to work - programs.nix-ld.enable = true; + programs = { + steam.enable = true; - programs.ssh.askPassword = lib.mkForce "${pkgs.kdePackages.ksshaskpass}/bin/ksshaskpass"; + ssh.askPassword = lib.mkForce "${pkgs.kdePackages.ksshaskpass}/bin/ksshaskpass"; - programs.steam.enable = true; + #In order for dynamically linked executables to work + nix-ld.enable = true; + }; # Configure console keymap console.keyMap = "de"; - hardware.enableRedistributableFirmware = true; - #Enables proprietary, redistributable firmware so hardware devices function properly + hardware = { + #Enables proprietary, redistributable firmware so hardware devices function properly + enableRedistributableFirmware = true; - hardware.graphics = { - enable = true; - # Mesa should be enabled by default for Vulkan, but you can be explicit - enable32Bit = true; # For 32-bit applications - extraPackages = with pkgs; [ rocmPackages.clr.icd ]; - }; - - hardware.cpu.amd.updateMicrocode = true; - - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - settings = { - General = { - # Shows battery charge of connected devices on supported - # Bluetooth adapters. Defaults to 'false'. - Experimental = true; - # When enabled other devices can connect faster to us, however - # the tradeoff is increased power consumption. Defaults to - # 'false'. - FastConnectable = true; - }; - Policy = { - # Enable all controllers when they are found. This includes - # adapters present on start as well as adapters that are plugged - # in later on. Defaults to 'true'. - AutoEnable = true; - }; + graphics = { + enable = true; + # Mesa should be enabled by default for Vulkan, but you can be explicit + enable32Bit = true; # For 32-bit applications + extraPackages = with pkgs; [ rocmPackages.clr.icd ]; }; - }; - # security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - pulse.enable = true; - #jack.enable = true; - }; + cpu.amd.updateMicrocode = true; - services.pipewire.wireplumber = { - enable = true; - extraConfig = { - "10-bluez-monitor.properties" = { - "bluez5.msbc-support" = false; - "bluez5.hfphsp-support" = false; - "bluez5.hfphsp-backend" = "none"; # Key addition: no backend - "bluez5.roles" = [ "a2dp_sink" ]; - }; - "11-bluetooth-policy" = { - "wireplumber.settings" = { - "bluetooth.autoswitch-to-headset-profile" = false; + amdgpu.opencl.enable = true; + + bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General = { + # Shows battery charge of connected devices on supported + # Bluetooth adapters. Defaults to 'false'. + Experimental = true; + # When enabled other devices can connect faster to us, however + # the tradeoff is increased power consumption. Defaults to + # 'false'. + FastConnectable = true; + }; + Policy = { + # Enable all controllers when they are found. This includes + # adapters present on start as well as adapters that are plugged + # in later on. Defaults to 'true'. + AutoEnable = true; }; }; }; }; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.${username} = { isNormalUser = true; @@ -257,12 +252,28 @@ ]; }; - virtualisation.docker.enable = true; + virtualisation = { + docker.enable = true; - environment.etc."gitconfig".text = '' - [init] - defaultBranch = main - ''; + waydroid.enable = true; + }; + + environment = { + etc."gitconfig".text = '' + [init] + defaultBranch = main + ''; + + variables = { + EDITOR = "nvim"; + # XKB_DEFAULT_LAYOUT = "de"; + }; + + sessionVariables = { + NIXOS_OZONE_WL = "1"; #For chromium to work under wayland and with virtual Keyboards (Only really needed for virtual keyboards, but doest hurt ...) + TERMINAL = "kitty"; + }; + }; #So no user in the group Wheel has to input the password in order to use sudo security.sudo.wheelNeedsPassword = false; @@ -273,31 +284,6 @@ # Allow unfree packages nixpkgs.config.allowUnfree = true; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - environment.variables = { - EDITOR = "nvim"; - # XKB_DEFAULT_LAYOUT = "de"; - }; - - environment.sessionVariables = { - NIXOS_OZONE_WL = "1"; #For chromium to work under wayland and with virtual Keyboards (Only really needed for virtual keyboards, but doest hurt ...) - TERMINAL = "kitty"; - }; - - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/modules/firefox.nix b/modules/firefox.nix index aa239b8..b98a324 100644 --- a/modules/firefox.nix +++ b/modules/firefox.nix @@ -74,6 +74,7 @@ #(extension "react-devtools" "@react-devtools") (extension "keepa" "amptra@keepa.com") (extension "redditUntranslate" "reddit-url-redirector@kichkoupi.com") + (extension "darkreader" "addon@darkreader.org") ]; /* ---- PREFERENCES ---- */ diff --git a/modules/home.nix b/modules/home.nix index 83f86b1..80c9474 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -70,7 +70,7 @@ }; zen-browser = { - enable = true; + enable = false; #package = inputs.zen-browser.packages.${pkgs.system}.default; profiles = { ${username} = { diff --git a/modules/packages/cli.nix b/modules/packages/cli.nix index 5a9929f..cd6da73 100644 --- a/modules/packages/cli.nix +++ b/modules/packages/cli.nix @@ -2,18 +2,19 @@ { environment.systemPackages = with pkgs; [ #CLI tools - pdftk - yt-dlp - tailscale - speedtest-cli + pdftk #PDF toolkit + yt-dlp #YouTube and others video downloader + tailscale #VPN + speedtest-cli #Internet speed tester #duplicati #ollama cloudflare-warp ddrescue texliveFull #LaTeX PDF maker - lazygit - gtypist - powertop - file + lazygit #Git CLI tool with TUI + gtypist #Typing tutor + powertop #Power consumption monitor and optimizer + file #File type identifier + hashcat #Password recovery/cracking tool ]; } diff --git a/modules/packages/desktop.nix b/modules/packages/desktop.nix index 0c56e17..cd62af2 100644 --- a/modules/packages/desktop.nix +++ b/modules/packages/desktop.nix @@ -3,61 +3,53 @@ environment.systemPackages = with pkgs; [ #Programming - #jetbrains.pycharm-community #The PyCharm IDE to edit Python code - #jetbrains.idea-community #The IntelliJ IDE to edit Java code - #jetbrains.clion #The CLion IDE to edit and compile c/c++ code - jetbrains-toolbox + jetbrains.pycharm-community #The PyCharm IDE to edit Python code + jetbrains.idea-community #The IntelliJ IDE to edit Java code + jetbrains.clion #The CLion IDE to edit and compile c/c++ code + jetbrains.datagrip #The DataGrip IDE to manage Databases #racket #The racket Programming language, with DrRacket IDE, for University (*Not* because it's my favourite) rustup #Rust Programming Toolchain #go #Go Programming Language - gcc + gcc #C/C++ Compiler pkg-config vscode #Editor for all kinds of programms - nodejs_22 + nodejs_22 #NodeJS for JavaScript programming #Hochschule - postgresql - dbeaver-bin - sqlite + postgresql #Database system + dbeaver-bin #Database Management Tool + sqlite #Lightweight Database system #Desktop Applications drawio - #jetbrains.datagrip - ryubing - vlc - #steam - #heroic - lutris - #putty Need to find alternative as it sucks on linux - mission-center - trayscale - spotify - rpi-imager - kdePackages.yakuake - atlauncher + ryubing #Nintendo Switch Emulator + vlc #VLC Media Player + lutris #Gaming Platform + mission-center #For a Task Manager like GUI + trayscale #Tailscale unofficial GUI + spotify #Spotify Music Client + rpi-imager #Raspberry Pi Imager + atlauncher #Minecraft Launcher #discord - vesktop + vesktop #Aternative for discord on Wayland wineWowPackages.stagingFull winetricks - wasistlos #Whatsapp - #obs-studio - #i2p + wasistlos #Whatsapp + #obs-studio #Screen Recorder gparted #Disk partition Manager - #rustdesk - realvnc-vnc-viewer - eddie #AirVPN desktop client - chromium #For Youtube app to work - kdePackages.bluez-qt - moonlight-qt - kitty + #rustdesk #Remote Desktop Client + realvnc-vnc-viewer #VNC Remote Desktop Client + eddie #AirVPN desktop client + chromium #Chromium browser for Youtube app to work + moonlight-qt #Game Streaming Client + kitty #Kitty Terminal Emulator wmctrl #To Force windows into fullscreen - kdePackages.dolphin - persepolis #Download Manager - libreoffice-still + kdePackages.dolphin #KDE File Browser + libreoffice-still #Office Suite kdePackages.kservice - qbittorrent - waydroid #Android - grim - gimp2-with-plugins + qbittorrent #Torrent Client + waydroid #Android emulator on Linux + gimp2-with-plugins #Image Editor + kdePackages.filelight #Disk Usage Analyzer ]; } diff --git a/modules/packages/essentials.nix b/modules/packages/essentials.nix index 2c9fcbb..395c5c8 100644 --- a/modules/packages/essentials.nix +++ b/modules/packages/essentials.nix @@ -1,18 +1,16 @@ {config, pkgs, libs, inputs, nix-flatpak, ...}: { environment.systemPackages = with pkgs; [ - #Essentials (CLI Only) wget #A tool for quickly downloading things from the Web - micro-with-xclip #Micro text editor with xclip for clipboard - javaPackages.compiler.openjdk25 #Java Development Kit 23 + javaPackages.compiler.openjdk25 #Java Development Kit 25 python312 #Python 3.12 python312Packages.pip #Pip for Python 3.12 python312Packages.cmake #The CMake tool to manage project build configurations fastfetch #A utility to see information about your machine btop #A replacement for htop to see your machines resources git #Git ... no need to explain - efibootmgr + efibootmgr #A tool to manage UEFI boot entries zip #A utility for ZIP archives unzip #A utility for ZIP archives rar #A utility for RAR archives @@ -21,23 +19,24 @@ tmux #A tool to let command windows contiune to run in the background home-manager #A package to also edit the user Configuration, like with nix konsave #A package to transfer the look and feel of KDE Plasma to other machines - ocs-url - kdePackages.plasma-workspace - kdePackages.kdialog openssh #SSH zoxide #Alternatice to cd, browse files fzf-zsh #Search for file names - coreutils-full + coreutils-full #Full set of coreutils, including some missing ones multipath-tools - docker - docker-compose - plymouth - mesa - fprintd - nh - whois - networkmanagerapplet - zoxide - pocl + docker #Docker ... no need to explain + docker-compose #Docker Compose for docker + plymouth #Boot Splash screen + mesa #Graphics drivers + fprintd #Fingerprint reader support + nh + whois #To find out domain information + networkmanagerapplet #For managing network manager connections + zoxide #Alternative to cd, browse files + pocl #Portable OpenCL implementation + clinfo #OpenCL info tool + rocmPackages.rocm-runtime #AMD ROCm runtime + ripgrep #Alternative to grep search for text in files + pipewire #Multimedia handling ]; } diff --git a/modules/stylix/default.nix b/modules/stylix/default.nix index 4116a0a..e9e2f94 100644 --- a/modules/stylix/default.nix +++ b/modules/stylix/default.nix @@ -13,7 +13,7 @@ stylix = { enable = true; autoEnable = false; #So I can choose my programs it targets myself! - image = ../../other/wallpaper2.png; + #image = ../../other/wallpaper2.png; #autoEnable = true; #Auto generate theme based on wallpaper base16Scheme = "${pkgs.base16-schemes}/share/themes/dracula.yaml"; opacity = { diff --git a/plasma/autostart.nix b/plasma/autostart.nix index c3de6a7..eabc25a 100644 --- a/plasma/autostart.nix +++ b/plasma/autostart.nix @@ -9,7 +9,7 @@ #after = [ "plasma-desktop.service" ]; wantedBy = [ "graphical-session.target" ]; serviceConfig = { - ExecStart = [ "/run/current-system/sw/bin/plasma-apply-wallpaperimage /home/${username}/${project}/other/wallpaper2.png" ]; + ExecStart = [ "/run/current-system/sw/bin/plasma-apply-wallpaperimage /home/${username}/${project}/other/wallpaper3.png" ]; Type = "oneshot"; Restart = "on-failure"; diff --git a/plasma/plasma.nix b/plasma/plasma.nix index 1904902..73722db 100644 --- a/plasma/plasma.nix +++ b/plasma/plasma.nix @@ -3,7 +3,7 @@ let # Define the custom background package with the correct relative path background-package = pkgs.stdenvNoCC.mkDerivation { name = "background-image"; - src = ../other/wallpaper2.png; # Place wallpaper.jpg in the same directory as this config file + src = ../other/wallpaper4.png; # Place wallpaper.jpg in the same directory as this config file dontUnpack = true; installPhase = '' cp $src $out @@ -56,47 +56,35 @@ in wayland.enable = true; }; }; + + # Enable the KDE Plasma Desktop Environment. + desktopManager.plasma6.enable = true; }; - virtualisation.waydroid.enable = true; - - # Enable the X11 windowing system. - # You can disable this if you're only using the Wayland session. - #services.xserver.enable = true; - - # Configure keymap in X11 - #services.xserver.xkb = { - # layout = "de"; - # variant = ""; - #}; - system.activationScripts.script.text = '' source /home/${username}/${project}/other/colors.sh source /home/${username}/${project}/other/pfp.sh ''; - #services.displayManager.sddm = { - # enable = true; - # theme = "breeze"; - # wayland.enable = true; - #}; + environment = { + + plasma6.excludePackages = with pkgs; [ + kdePackages.elisa + ]; - # Enable the KDE Plasma Desktop Environment. - services.desktopManager.plasma6.enable = true; + systemPackages = with pkgs; [ + (pkgs.writeTextDir "share/sddm/themes/breeze/theme.conf.user" '' + [General] + background = "${background-package}" + '') #Custom SDDM theme with background image + kdePackages.plymouth-kcm + xdg-desktop-portal + kdePackages.xdg-desktop-portal-kde + kdePackages.plasma-workspace + kdePackages.kdialog + kdePackages.yakuake #Drop down Terminal + kdePackages.bluez-qt #Bluetooth management for KDE Plasma + ]; + }; - environment.plasma6.excludePackages = with pkgs; [ -# kdePackages.konsole #Using Kitty instead - kdePackages.elisa - ]; - - environment.systemPackages = with pkgs; [ - kdePackages.plymouth-kcm - (pkgs.writeTextDir "share/sddm/themes/breeze/theme.conf.user" '' - [General] - background = "${background-package}" - '') - xdg-desktop-portal - kdePackages.xdg-desktop-portal-kde - pipewire - ]; }