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"; user = "r3ddy";
email = personalEmail; email = personalEmail;
gamingSystem = true; gamingSystem = true;
# Currently supported: plasma, gnome, hyprland
desktopEnvironment = "plasma";
}; };
}; };
} }

View File

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

View File

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

View File

@@ -1,16 +1,22 @@
{ currentSystemUser, ... }: { currentSystemUser, ... }:
{ {
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
settings = { settings = {
"$mod" = "SUPER"; "$mod" = "SUPER";
bind = [ bind = [
"$mod, Return, exec, kitty" "$mod, Return, exec, kitty"
"$mod, F, fullscreen"
"$mod, SPACE, exec, wofi --show run" "$mod, SPACE, exec, wofi --show run"
"$mod SHIFT, Q, killactive"
"$mod SHIFT, L, exec, hyprlock" "$mod SHIFT, L, exec, hyprlock"
"$mod SHIFT, Q, killactive"
"$mod, F, fullscreen"
"$mod, H, movefocus, l" "$mod, H, movefocus, l"
"$mod, L, movefocus, r" "$mod, L, movefocus, r"
"$mod, K, movefocus, u" "$mod, K, movefocus, u"
@@ -19,6 +25,18 @@
"$mod SHIFT, L, movewindow, r" "$mod SHIFT, L, movewindow, r"
"$mod SHIFT, K, movewindow, u" "$mod SHIFT, K, movewindow, u"
"$mod SHIFT, J, movewindow, d" "$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: builtins.concatLists (builtins.genList (i:
let ws = i + 1; let ws = i + 1;
@@ -42,12 +60,16 @@
}; };
sensitivity = "0"; sensitivity = "0";
accel_profile = "flat";
}; };
exec-once = [ exec-once = [
"waybar" "waybar"
"hyprpaper" "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, overlays,
nixvim, nixvim,
@@ -11,7 +11,8 @@ name:
email, email,
wsl ? false, wsl ? false,
stable ? false, stable ? false,
gamingSystem ? false gamingSystem ? false,
desktopEnvironment ? ""
}: }:
let let
# True if this is a WSL system. # True if this is a WSL system.
@@ -62,6 +63,7 @@ let
currentSystemName = name; currentSystemName = name;
currentSystemUser = user; currentSystemUser = user;
currentSystemEmail = email; currentSystemEmail = email;
currentSystemDe = desktopEnvironment;
gamingSystem = gamingSystem; gamingSystem = gamingSystem;
isWSL = isWSL; isWSL = isWSL;
isDarwin = isDarwin; isDarwin = isDarwin;

View File

@@ -1,12 +1,20 @@
{ pkgs, ... }: { lib, currentSystemDe, ... }:
{ {
services.flatpak.enable = true; services.flatpak.enable = true;
services.xserver.videoDrivers = ["nvidia"]; services.xserver.videoDrivers = ["nvidia"];
services.xserver.enable = true; services.xserver.enable = true;
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true; # Display managers
services.displayManager.sddm.wayland.enable = true; 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. # Enable sound with pipewire.
services.pulseaudio.enable = false; services.pulseaudio.enable = false;

View File

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