Added desktop environments

This commit is contained in:
2025-05-08 14:46:36 +02:00
parent 1581a55e46
commit 1efa96105e
7 changed files with 71 additions and 17 deletions

View File

@@ -46,6 +46,8 @@
user = "r3ddy";
email = personalEmail;
gamingSystem = true;
# Currently supported: plasma, gnome, hyprland
desktopEnvironment = "plasma";
};
};
}

View File

@@ -1,4 +1,4 @@
{ currentSystemUser, ... }:
{ currentSystemUser, currentSystemDe, ... }:
{
imports = [
./nvim
@@ -7,12 +7,13 @@
./git.nix
./kitty.nix
./zoxide.nix
] ++ (if currentSystemDe == "hyprland" then [
./hyprland.nix
./wofi.nix
./hyprlock.nix
./waybar.nix
];
] else []
);
home.username = "${currentSystemUser}";

View File

@@ -3,9 +3,12 @@
programs.fish = {
enable = true;
interactiveShellInit = ''
set fish_greeting # Disable greeting
fish_config theme choose Catppuccin\ Mocha
function fish_greeting
krabby random --no-title --padding-left 2
end
function weather
curl "wttr.in/Bolzano?0?Q?"
end

View File

@@ -1,16 +1,22 @@
{ currentSystemUser, ... }:
{
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
wayland.windowManager.hyprland = {
enable = true;
settings = {
"$mod" = "SUPER";
bind = [
"$mod, Return, exec, kitty"
"$mod, F, fullscreen"
"$mod, SPACE, exec, wofi --show run"
"$mod SHIFT, Q, killactive"
"$mod SHIFT, L, exec, hyprlock"
"$mod SHIFT, Q, killactive"
"$mod, F, fullscreen"
"$mod, H, movefocus, l"
"$mod, L, movefocus, r"
"$mod, K, movefocus, u"
@@ -19,6 +25,18 @@
"$mod SHIFT, L, movewindow, r"
"$mod SHIFT, K, movewindow, u"
"$mod SHIFT, J, movewindow, d"
"$mod SHIFT, right, resizeactive, 30 0"
"$mod SHIFT, left, resizeactive, -30 0"
"$mod SHIFT, up, resizeactive, 0 -30"
"$mod SHIFT, down, resizeactive, 0 30"
"$mod SHIFT, U, togglefloating"
",XF86MonBrightnessDown, exec, brightnessctl set 2%-"
",XF86MonBrightnessUp, exec, brightnessctl set +2%"
",XF86AudioLowerVolume, exec, pamixer -d 2"
",XF86AudioRaiseVolume, exec, pamixer -i 2"
"$mod, delete, exit"
] ++ (
builtins.concatLists (builtins.genList (i:
let ws = i + 1;
@@ -42,12 +60,16 @@
};
sensitivity = "0";
accel_profile = "flat";
};
exec-once = [
"waybar"
"hyprpaper"
];
exec = [
];
};
};

View File

@@ -1,4 +1,4 @@
# This file comes from https://github.com/kahlstrm/nixos-config/blob/main/lib/mksystem.nix
# This file is based on https://github.com/kahlstrm/nixos-config/blob/main/lib/mksystem.nix
{
overlays,
nixvim,
@@ -11,7 +11,8 @@ name:
email,
wsl ? false,
stable ? false,
gamingSystem ? false
gamingSystem ? false,
desktopEnvironment ? ""
}:
let
# True if this is a WSL system.
@@ -62,6 +63,7 @@ let
currentSystemName = name;
currentSystemUser = user;
currentSystemEmail = email;
currentSystemDe = desktopEnvironment;
gamingSystem = gamingSystem;
isWSL = isWSL;
isDarwin = isDarwin;

View File

@@ -1,12 +1,20 @@
{ pkgs, ... }:
{ lib, currentSystemDe, ... }:
{
services.flatpak.enable = true;
services.xserver.videoDrivers = ["nvidia"];
services.xserver.enable = true;
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;
services.displayManager.sddm.wayland.enable = true;
# Display managers
services.displayManager.sddm = lib.mkIf (currentSystemDe == "plasma") {
enable = true;
wayland.enable = true;
};
services.xserver.displayManager.gdm.enable = lib.mkIf (currentSystemDe == "gnome") true;
# Desktop environments
services.desktopManager.plasma6.enable = lib.mkIf (currentSystemDe == "plasma") true;
services.xserver.desktopManager.gnome.enable = lib.mkIf (currentSystemDe == "gnome") true;
# Enable sound with pipewire.
services.pulseaudio.enable = false;

View File

@@ -1,4 +1,4 @@
{ pkgs, gamingSystem, ... }:
{ pkgs, gamingSystem, currentSystemDe, ... }:
{
environment.systemPackages = with pkgs; [
# CLI utils
@@ -14,6 +14,7 @@
htop
jq
killall
krabby
md2pdf
nmap
python3
@@ -41,12 +42,9 @@
# GUI applications
baobab
brave
hyprpaper
kdePackages.xdg-desktop-portal-kde
kitty
mpv
nextcloud-client
pavucontrol
spotube
telegram-desktop
@@ -58,6 +56,14 @@
prismlauncher
steam
vesktop
] else [])
++ (if currentSystemDe == "hyprland" then [
# Hyprland
brightnessctl
hyprpaper
pamixer
pavucontrol
kdePackages.dolphin
] else []);
programs.steam = if gamingSystem then {
@@ -65,10 +71,20 @@
remotePlay.openFirewall = true;
} else {};
programs.hyprland.enable = true;
programs.hyprland.enable = if currentSystemDe == "hyprland" then true else false;
programs.nh = {
enable = true;
clean.enable = true;
};
xdg = {
autostart.enable = true;
portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
};
};
}