diff --git a/hosts/nixos-test/home.nix b/hosts/nixos-test/home.nix new file mode 100644 index 0000000..86211b2 --- /dev/null +++ b/hosts/nixos-test/home.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + + ]; +} \ No newline at end of file diff --git a/hosts/nixos-test/default.nix b/hosts/nixos-test/system.nix similarity index 74% rename from hosts/nixos-test/default.nix rename to hosts/nixos-test/system.nix index e45767e..2e086ab 100644 --- a/hosts/nixos-test/default.nix +++ b/hosts/nixos-test/system.nix @@ -7,16 +7,6 @@ { imports = [ - ../../modules/linux_gaming.nix - ../../modules/system.nix - ../../modules/network.nix - ../../modules/keymaps/us.nix - ../../modules/pipewire.nix - ../../modules/plasma.nix - ../../modules/plymouth.nix - - ../../modules # Import optional configuration - # Include the results of the hardware scan. ./hardware-configuration.nix ]; diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 0000000..a7d6a57 --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,5 @@ +{ config, ... }: + +{ + +} \ No newline at end of file diff --git a/modules/ai.nix b/modules/ai.nix deleted file mode 100644 index 842fa22..0000000 --- a/modules/ai.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, pkgs, lib, ... }: -with lib; -{ - options.customModules.AI = { - enable = mkEnableOption '' - Enable AI - ''; - }; - config = - let - cfg = config.customModules.AI; - nvidiaEnabled = config.hardware.nvidia.modesetting.enable; - in - mkIf cfg.enable { - services.ollama = { - enable = true; - - acceleration = - if nvidiaEnabled then - "cuda" - else - null; - }; - } - // mkIf nvidiaEnabled { environment.systemPackages = with pkgs; [cudatoolkit]; }; -} \ No newline at end of file diff --git a/modules/bluetooth.nix b/modules/bluetooth.nix deleted file mode 100644 index 820709f..0000000 --- a/modules/bluetooth.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, pkgs, ... }: - -{ - hardware.bluetooth.enable = true; -} diff --git a/modules/default.nix b/modules/default.nix index 979c98e..c1e82bb 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,7 +1,10 @@ -{ ... }: +{ config, pkgs, ... }: { imports = [ - ./gpuPassthrough + ./cli + ./desktop + ./server + ./system ]; } \ No newline at end of file diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 351272f..a2d21b4 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -4,9 +4,12 @@ imports = [ ./chromium ./flatpak + ./gamingKernel + ./gnome ./hyprland - ./jetbrains-toolbox + ./jetbrainsToolbox ./kitty + ./plasma ./vscode ]; } \ No newline at end of file diff --git a/modules/desktop/gamingKernel/default.nix b/modules/desktop/gamingKernel/default.nix new file mode 100644 index 0000000..202c935 --- /dev/null +++ b/modules/desktop/gamingKernel/default.nix @@ -0,0 +1,16 @@ +{ config, pkgs, lib, ... }: + +with lib; +let + cfg = config.modules.desktop.gamingKernel; +in +{ + options.modules.desktop.gamingKernel = { + enable = mkEnableOption '' + Enable gaming kernel with my custom configurations + ''; + }; + config = mkIf cfg.enable { + virtualisation.waydroid.enable = true; + }; +} \ No newline at end of file diff --git a/modules/desktop/gnome/default.nix b/modules/desktop/gnome/default.nix new file mode 100644 index 0000000..91ffddf --- /dev/null +++ b/modules/desktop/gnome/default.nix @@ -0,0 +1,23 @@ +{ config, pkgs, lib, ... }: + +with lib; +let + cfg = config.modules.desktop.gnome; +in +{ + options.modules.desktop.gnome = { + enable = mkEnableOption '' + Enable gnome with my custom configurations + ''; + }; + config = mkIf cfg.enable { + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the Gnome Desktop Environment. + services.xserver.displayManager.gdm.enable = true; + + # Enable the GNOME shell. + services.xserver.desktopManager.gnome.enable = true; + }; +} \ No newline at end of file diff --git a/modules/desktop/jetbrains-toolbox/default.nix b/modules/desktop/jetbrainsToolbox/default.nix similarity index 100% rename from modules/desktop/jetbrains-toolbox/default.nix rename to modules/desktop/jetbrainsToolbox/default.nix diff --git a/modules/desktop/plasma/default.nix b/modules/desktop/plasma/default.nix new file mode 100644 index 0000000..2a090df --- /dev/null +++ b/modules/desktop/plasma/default.nix @@ -0,0 +1,42 @@ +{ config, pkgs, lib, ... }: + +with lib; +let + cfg = config.modules.system.plymouth; +in +{ + options.modules.system.plymouth = { + enable = mkEnableOption '' + Enable plymouth with my custom configurations + ''; + }; + config = mkIf cfg.enable { + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the KDE Plasma Desktop Environment. + services.displayManager = { + sddm.enable = true; + defaultSession = "plasma"; + }; + services.desktopManager.plasma6.enable = true; + + programs.kdeconnect.enable = true; + + environment.systemPackages = with pkgs; with kdePackages; [ + krfb # Use by kdeconnect for virtualmonitorplugin "krfb-virtualmonitor" + discover + + # Usefull for automatic informations collect software like KDE + vulkan-tools # For vulkaninfo command + wayland-utils # For wayland-info command + glxinfo + clinfo + ]; + + # Uncomment when kwin is available in nixpkgs and NVIDIA 555 + nixpkgs.overlays = [ + (import ../overlays/kwin) + ]; + }; +} \ No newline at end of file diff --git a/modules/desktop/waydroid/default.nix b/modules/desktop/waydroid/default.nix new file mode 100644 index 0000000..8960503 --- /dev/null +++ b/modules/desktop/waydroid/default.nix @@ -0,0 +1,16 @@ +{ config, pkgs, lib, ... }: + +with lib; +let + cfg = config.modules.desktop.waydroid; +in +{ + options.modules.desktop.waydroid = { + enable = mkEnableOption '' + Enable waydroid with my custom configurations + ''; + }; + config = mkIf cfg.enable { + boot.kernelPackages = pkgs.linuxPackages_zen; + }; +} \ No newline at end of file diff --git a/modules/docker.nix b/modules/docker.nix deleted file mode 100644 index 886f2a2..0000000 --- a/modules/docker.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, pkgs, ... }: - -{ - virtualisation.docker.enable = true; - virtualisation.docker.enableNvidia = config.hardware.nvidia.modesetting.enable; - users.users.florian.extraGroups = [ "docker" ]; -} diff --git a/modules/gnome.nix b/modules/gnome.nix deleted file mode 100644 index 2314d6d..0000000 --- a/modules/gnome.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, ... }: -{ - # Enable the X11 windowing system. - services.xserver.enable = true; - - # Enable the Gnome Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - - # Enable the GNOME shell. - services.xserver.desktopManager.gnome.enable = true; -} diff --git a/modules/gpuPassthrough/default.nix b/modules/gpuPassthrough/default.nix deleted file mode 100644 index 6bfa3d0..0000000 --- a/modules/gpuPassthrough/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, pkgs, lib, ... }: -with lib; -{ - options.customModules.gpuPassthrough = { - enable = mkEnableOption '' - Enable gpu passthgrouth with my custom configurations - ''; - }; - config = - let - cfg = config.customModules.gpuPassthrough; - in - mkIf cfg.enable { - programs.virt-manager.enable = true; - - virtualisation.libvirtd = { - enable = true; - - hooks.qemu = { - is_working = "${pkgs.writeShellScript "testHook.sh" '' - touch /tmp/qemu_hook_is_working - ''}"; - }; - }; - }; -} \ No newline at end of file diff --git a/modules/gpuPassthrough/scripts/alloc_hugepages.sh b/modules/gpuPassthrough/scripts/alloc_hugepages.sh deleted file mode 100644 index bd96923..0000000 --- a/modules/gpuPassthrough/scripts/alloc_hugepages.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -## Load the config file -source "/etc/libvirt/hooks/kvm.conf" - -## Calculate number of hugepages to allocate from memory (in MB) -HUGEPAGES="$(($VM_MEMORY/$(($(grep Hugepagesize /proc/meminfo | awk '{print $2}')/1024))))" - -echo "Allocating hugepages..." -echo $HUGEPAGES > /proc/sys/vm/nr_hugepages -ALLOC_PAGES=$(cat /proc/sys/vm/nr_hugepages) - -TRIES=0 -while (( $ALLOC_PAGES != $HUGEPAGES && $TRIES < 1000 )) -do - echo 1 > /proc/sys/vm/compact_memory ## defrag ram - echo $HUGEPAGES > /proc/sys/vm/nr_hugepages - ALLOC_PAGES=$(cat /proc/sys/vm/nr_hugepages) - echo "Succesfully allocated $ALLOC_PAGES / $HUGEPAGES" - let TRIES+=1 -done - -if [ "$ALLOC_PAGES" -ne "$HUGEPAGES" ] -then - echo "Not able to allocate all hugepages. Reverting..." - echo 0 > /proc/sys/vm/nr_hugepages - exit 1 -fi diff --git a/modules/gpuPassthrough/scripts/cpu_mode_ondemand.sh b/modules/gpuPassthrough/scripts/cpu_mode_ondemand.sh deleted file mode 100644 index 07a5b4a..0000000 --- a/modules/gpuPassthrough/scripts/cpu_mode_ondemand.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -## Enable CPU governor on-demand mode -cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor -for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "ondemand" > $file; done -cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor diff --git a/modules/gpuPassthrough/scripts/cpu_mode_performance.sh b/modules/gpuPassthrough/scripts/cpu_mode_performance.sh deleted file mode 100644 index 7a1c821..0000000 --- a/modules/gpuPassthrough/scripts/cpu_mode_performance.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -## Enable CPU governor performance mode -cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor -for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "performance" > $file; done -cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor diff --git a/modules/gpuPassthrough/scripts/dealloc_hugepages.sh b/modules/gpuPassthrough/scripts/dealloc_hugepages.sh deleted file mode 100644 index 887bc1e..0000000 --- a/modules/gpuPassthrough/scripts/dealloc_hugepages.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -echo 0 > /proc/sys/vm/nr_hugepages diff --git a/modules/gpuPassthrough/scripts/start.sh b/modules/gpuPassthrough/scripts/start.sh deleted file mode 100644 index c6a2f7a..0000000 --- a/modules/gpuPassthrough/scripts/start.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# Helpful to read output when debugging -set -x - -# Load variables -source "/etc/libvirt/hooks/kvm.conf" - -# Stop display manager -systemctl stop gdm.service - -# Unbind VTconsoles -echo 0 > /sys/class/vtconsole/vtcon0/bind -echo 0 > /sys/class/vtconsole/vtcon1/bind - -# Unbind EFI-Framebuffer -echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind - -# Avoid a Race condition -sleep 5 - -# Unload all Nvidia drivers -modprobe -r nvidia_drm -modprobe -r nvidia_modeset -modprobe -r nvidia_uvm -modprobe -r nvidia - -# Unbind the GPU from display driver -virsh nodedev-detach $VIRSH_GPU_VIDEO -virsh nodedev-detach $VIRSH_GPU_AUDIO -virsh nodedev-detach $VIRSH_USB -virsh nodedev-detach $VIRSH_SERIAL_BUS - -# Load VFIO Kernel Module -modprobe vfio-pci diff --git a/modules/gpuPassthrough/scripts/stop.sh b/modules/gpuPassthrough/scripts/stop.sh deleted file mode 100644 index 9d7d483..0000000 --- a/modules/gpuPassthrough/scripts/stop.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -set -x - -# Load variables -source "/etc/libvirt/hooks/kvm.conf" - -# Unload VFIO-PCI Kernel Driver -modprobe -r vfio-pci -modprobe -r vfio_iommu_type1 -modprobe -r vfio - -# Re-Bind GPU to Nvidia Driver -virsh nodedev-reattach $VIRSH_GPU_VIDEO -virsh nodedev-reattach $VIRSH_GPU_AUDIO -virsh nodedev-reattach $VIRSH_USB -virsh nodedev-reattach $VIRSH_SERIAL_BUS - -# Rebind VT consoles -echo 1 > /sys/class/vtconsole/vtcon0/bind -echo 1 > /sys/class/vtconsole/vtcon1/bind - -# Bind EFI-Framebuffer -nvidia-xconfig --query-gpu-info > /dev/null 2>&1 -echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind - -# Load all Nvidia drivers -modprobe nvidia_drm -modprobe nvidia_modeset -modprobe drm_kms_helper -modprobe drm -modprobe nvidia_uvm -modprobe nvidia - -# Restart Display Manager -systemctl start gdm.service diff --git a/modules/gpuPassthrough/win10/win10.xml b/modules/gpuPassthrough/win10/win10.xml deleted file mode 100644 index 59e8aa6..0000000 --- a/modules/gpuPassthrough/win10/win10.xml +++ /dev/null @@ -1,247 +0,0 @@ - - win10 - b3d036ee-75ff-43fe-be76-b8c5494f5dd7 - - - - - - 25165824 - 25165824 - - - - 32 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - hvm - /usr/share/edk2-ovmf/x64/OVMF_CODE.fd - /var/lib/libvirt/qemu/nvram/win10_VARS.fd - - - - - - - - - - - - - - - - - - - - - - - - - - - - destroy - restart - destroy - - - - - - /usr/bin/qemu-system-x86_64 - - - - - -
- - - - - - -
- - - - - - -
- - -
- - -
- - - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - -
- - - - - -
- - - -