From 75b84ddd0ff0320285a70441e754d4a3410cf0cd Mon Sep 17 00:00:00 2001 From: cookiez Date: Thu, 14 Aug 2025 14:13:13 +0200 Subject: [PATCH] Separated Kde-Plasma from other configs. Started work on Hyprland config! --- configuration.nix | 71 ++++++++++++----------------------------------- flake.nix | 4 +-- home.nix | 24 ++++++++++++++++ hyprland.nix | 24 ++++++++-------- kde-plasma.nix | 62 +++++++++++++++++++++++++++++++++++++++++ lockscreen.nix | 29 ------------------- other/aliases | 9 +++++- zsh.nix | 2 ++ 8 files changed, 127 insertions(+), 98 deletions(-) create mode 100644 kde-plasma.nix delete mode 100644 lockscreen.nix diff --git a/configuration.nix b/configuration.nix index c05ebe2..a35cc7f 100644 --- a/configuration.nix +++ b/configuration.nix @@ -22,11 +22,6 @@ imports = [ ./hardware-configuration.nix - #Moved to flake.nix - #./packages.nix - #./firefox.nix - #./zsh.nix - #./lockscreen.nix ]; # Bootloader. @@ -83,21 +78,6 @@ LC_TIME = "de_DE.UTF-8"; }; - # Enable the X11 windowing system. - # You can disable this if you're only using the Wayland session. - services.xserver.enable = true; - - # Enable the KDE Plasma Desktop Environment. - services.displayManager.sddm.enable = true; - services.desktopManager.plasma6 = { - enable = true; - #Wallpaper options isnt available anymore in Plasma6 - #wallpaper = { - # mode = "scale"; - # image = "/etc/nixos/other/wallpaper.png"; - #}; - }; - services.ollama = { enable = true; # Optional: load models on startup @@ -108,16 +88,10 @@ enable = true; package = pkgs.plocate; #To get rid of warning - #Depircated: + #Depricated: #localuser = null; }; - # Configure keymap in X11 - services.xserver.xkb = { - layout = "de"; - variant = ""; - }; - services.tailscale.enable = true; fonts.packages = with pkgs; [ @@ -133,21 +107,21 @@ # Enable CUPS to print documents. services.printing.enable = true; - # Enable sound with pipewire. - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; +# # Enable sound with pipewire. +# services.pulseaudio.enable = false; +# security.rtkit.enable = true; +# services.pipewire = { +# enable = true; +# alsa.enable = true; +# alsa.support32Bit = true; +# pulse.enable = true; +# # If you want to use JACK applications, uncomment this +# #jack.enable = true; +# +# # use the example session manager (no others are packaged yet so this is enabled by default, +# # no need to redefine it in your config for now) +# #media-session.enable = true; +# }; # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; @@ -163,16 +137,7 @@ }; #So no user in the group Wheel has to input the password in order to use sudo - security.sudo.wheelNeedsPassword = false; - - #theme-reminder uses a definitive /home/cookiez path!!! - system.activationScripts.script.text = '' - source /etc/nixos/other/colors.sh - source /etc/nixos/other/pfp.sh - - source /etc/nixos/other/theme-reminder.sh - ''; - + security.sudo.wheelNeedsPassword = false; # #Install firefox. #programs.firefox.enable = true; @@ -187,8 +152,6 @@ # Allow unfree packages nixpkgs.config.allowUnfree = true; - programs.steam.enable = true; - # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; diff --git a/flake.nix b/flake.nix index d1c6e87..a9ee314 100644 --- a/flake.nix +++ b/flake.nix @@ -68,10 +68,10 @@ ./configuration.nix ./firefox.nix ./zsh.nix - ./autostart.nix + #./kde-plasma.nix #./neovim.nix + ./hyprland.nix ./packages.nix - ./lockscreen.nix grub2-themes.nixosModules.default home-manager.nixosModules.home-manager { diff --git a/home.nix b/home.nix index 79d9b33..af77481 100644 --- a/home.nix +++ b/home.nix @@ -103,4 +103,28 @@ }; }; }; + + + wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = true; + + extraConfig = + '' + input { + kb_layout = de + kb_variant = + kb_model = + kb_rules = + # kb_options = caps:Super_L + follow_mouse = 1 + accel_profile = flat + force_no_accel = true + touchpad { + natural_scroll = no + } + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. + } + ''; + }; } diff --git a/hyprland.nix b/hyprland.nix index 5738257..66fc847 100644 --- a/hyprland.nix +++ b/hyprland.nix @@ -20,18 +20,18 @@ # xwayland.enable = true; #}; - #xdg.portal = { - # enable = true; - # extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - #}; + xdg.portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; #sound.enable = true; - #security.rtkit.enable = true; - #services.pipewire = { - # enable = true; - # alsa.enable = true; - # alsa.support3Bbit = true; - # pulse.enable = true; - # jack.enable = true; - #} + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + #alsa.support3Bbit = true; + pulse.enable = true; + jack.enable = true; + }; } diff --git a/kde-plasma.nix b/kde-plasma.nix new file mode 100644 index 0000000..a71e74d --- /dev/null +++ b/kde-plasma.nix @@ -0,0 +1,62 @@ +{config, pkgs, ...}: + +let + # Define the custom background package with the correct relative path + background-package = pkgs.stdenvNoCC.mkDerivation { + name = "background-image"; + src = ./other/wallpaper.png; # Place wallpaper.jpg in the same directory as this config file + dontUnpack = true; + installPhase = '' + cp $src $out + ''; + }; +in + +{ + imports = + [ + #Example: + #./hardware-configuration.nix + ./autostart.nix + #Moved Back to flake until plasma theme configuration is done! + #./zsh.nix + ]; + + # 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 = ""; + }; + + #theme-reminder uses a definitive /home/cookiez path!!! + system.activationScripts.script.text = '' + source /etc/nixos/other/colors.sh + source /etc/nixos/other/pfp.sh + + source /etc/nixos/other/theme-reminder.sh + ''; + + services.displayManager.sddm = { + enable = true; + theme = "breeze"; + wayland.enable = true; + }; + + # Enable the KDE Plasma Desktop Environment. + services.desktopManager.plasma6.enable = true; + + environment.systemPackages = with pkgs; [ + (pkgs.writeTextDir "share/sddm/themes/breeze/theme.conf.user" '' + [General] + background = "${background-package}" + '') + ]; + + + programs.steam.enable = true; +} + diff --git a/lockscreen.nix b/lockscreen.nix deleted file mode 100644 index 8501d49..0000000 --- a/lockscreen.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, pkgs, lib, ... }: - -let - # Define the custom background package with the correct relative path - background-package = pkgs.stdenvNoCC.mkDerivation { - name = "background-image"; - src = ./other/wallpaper.png; # Place wallpaper.jpg in the same directory as this config file - dontUnpack = true; - installPhase = '' - cp $src $out - ''; - }; -in - -{ -# X11 and KDE Plasma configuration - #services.xserver.enable = true; - services.displayManager.sddm = { - enable = lib.mkDefault true; - theme = "breeze"; - wayland.enable = true; - }; - environment.systemPackages = with pkgs; [ - (pkgs.writeTextDir "share/sddm/themes/breeze/theme.conf.user" '' - [General] - background = "${background-package}" - '') - ]; -} diff --git a/other/aliases b/other/aliases index b2e689d..699493f 100644 --- a/other/aliases +++ b/other/aliases @@ -6,7 +6,7 @@ #----- alias py="python3" alias mcrow="sudo micro" - +alias srcals="source /etc/nixos/other/aliases && echo 'Sourced Aliases ... successful!'" @@ -36,3 +36,10 @@ alias nix-clear="sudo nix-store --gc" alias home-edit="sudoedit /etc/nixos/home.nix" alias cd-nix="cd /etc/nixos/" + + + +#Hyprland Specific +#----- +alias exit-hyprland="hyprctl dispatch exit" +alias hyprland-exit="hyprctl dispatch exit" diff --git a/zsh.nix b/zsh.nix index 7abcd41..430f964 100644 --- a/zsh.nix +++ b/zsh.nix @@ -12,6 +12,8 @@ source /etc/nixos/other/theme-reminder.sh ''; + + #To reset powerlevel10k, write 'p10k configure' in shell! promptInit = '' source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme '';