nix/nixos/common/desktops/hyprland/default.nix

159 lines
4.6 KiB
Nix
Raw Normal View History

2024-01-06 13:47:19 +01:00
{lib, inputs, pkgs, gpu, platform, theme, ...}: {
2023-08-14 15:02:45 +02:00
2023-08-27 13:06:16 +02:00
# nixpkgs = {
# overlays = [
# # https://github.com/nix-community/nixpkgs-wayland
# inputs.nixpkgs-wayland.overlay
# ];
# };
2023-08-27 12:35:58 +02:00
2024-01-05 08:10:10 +01:00
imports = [
inputs.stylix.nixosModules.stylix
2024-01-07 14:27:38 +01:00
../../../../../stylix/${theme}
2024-01-05 08:10:10 +01:00
];
2024-01-04 06:39:52 +01:00
2024-01-05 03:12:52 +01:00
stylix = {
2024-01-07 14:27:38 +01:00
image = /etc/nixos/git/wallpapers/${theme}/wallpaper1.png;
2024-01-07 07:50:30 +01:00
opacity = {
desktop = 0.7;
popups = 0.7;
applications = 1.0;
terminal = 1.0;
};
2024-01-05 03:12:52 +01:00
targets = {
plymouth.enable = false;
};
autoEnable = true;
fonts = {
serif = {
package = pkgs.dejavu_fonts;
name = "DejaVu Serif";
2024-01-04 06:39:52 +01:00
};
2024-01-05 03:12:52 +01:00
sansSerif = {
package = pkgs.dejavu_fonts;
name = "DejaVu Sans";
};
2024-01-04 06:39:52 +01:00
2024-01-05 03:12:52 +01:00
monospace = {
package = pkgs.dejavu_fonts;
name = "DejaVu Sans Mono";
};
2024-01-04 06:39:52 +01:00
2024-01-05 03:12:52 +01:00
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
2024-01-04 06:39:52 +01:00
};
};
2024-01-05 03:12:52 +01:00
};
2024-01-03 14:25:06 +01:00
2023-09-23 13:40:19 +02:00
services.xserver.videoDrivers = [ ] ++ lib.optional (builtins.isString gpu) gpu;
2023-08-27 12:35:58 +02:00
2023-08-17 08:40:32 +02:00
# tuigreet
2023-08-17 08:40:02 +02:00
services.greetd = {
2023-08-15 12:41:49 +02:00
enable = true;
2023-08-17 08:40:02 +02:00
settings = {
default_session = {
2024-01-04 14:22:55 +01:00
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland";
2023-08-17 08:40:02 +02:00
user = "greeter";
2023-08-15 15:09:48 +02:00
};
2023-08-15 13:49:57 +02:00
};
2023-08-15 12:41:49 +02:00
};
2023-08-15 12:21:32 +02:00
# Brightness and volume control
# https://haikarainen.github.io/light/
2023-08-15 12:21:32 +02:00
programs.light.enable = true;
2023-08-17 09:19:29 +02:00
# PolKit for the fingerprint reader
security.polkit.enable = true;
2023-08-17 12:26:20 +02:00
# https://github.com/NixOS/nixpkgs/issues/143365
security.pam.services.swaylock = {};
2023-08-15 12:21:32 +02:00
# Enabling hyprlnd on NixOS
programs.hyprland = {
enable = true;
2023-09-27 13:19:02 +02:00
# enableNvidiaPatches = true;
xwayland.enable = true;
};
environment.sessionVariables = {
# If your cursor becomes invisible, set this to 1
2023-08-27 12:35:58 +02:00
WLR_NO_HARDWARE_CURSORS = "0";
# Hint electron apps to use wayland
NIXOS_OZONE_WL = "1";
};
2023-08-30 01:28:18 +02:00
# https://www.freedesktop.org/software/systemd/man/logind.conf.html
2023-08-26 14:31:14 +02:00
services.logind.extraConfig = ''
IdleActionSec=900
IdleAction=suspend-then-hibernate
2023-08-30 01:28:18 +02:00
HandleLidSwitch=suspend-then-hibernate
HandleLidSwitchDocked=ignore
HandleLidSwitchExternalPower=suspend
2023-08-26 14:31:14 +02:00
'';
2023-08-30 01:28:18 +02:00
# https://www.systutorials.com/docs/linux/man/5-systemd-sleep.conf/
# HibernateDelaySec is the amount of time the
# system sleeps before entering hibernate when
# using suspend-then-hibernate
2023-08-27 08:21:27 +02:00
systemd.sleep.extraConfig = ''
2024-01-05 03:12:52 +01:00
AllowSuspend=yes
2024-01-05 03:16:53 +01:00
AllowHibernation=yes
2024-01-05 03:15:27 +01:00
AllowSuspendThenHibernate=yes
2024-01-05 03:12:52 +01:00
AllowHybridSleep=yes
HibernateDelaySec=600
2023-08-27 08:21:27 +02:00
'';
2023-08-14 13:01:44 +02:00
# XDG portal
xdg.portal.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
# system packages
2023-08-27 13:07:09 +02:00
environment.systemPackages = [
2024-01-07 10:19:12 +01:00
pkgs.waybar # taskbar
2023-08-27 13:07:09 +02:00
pkgs.libnotify # Notification libraries
pkgs.mako # Notification daemon
pkgs.swww # Wallpaper daemon
pkgs.kitty # Terminal emulator
pkgs.rofi-wayland # App Launcher
pkgs.grim # Screenshots
pkgs.slurp # Screenshots
pkgs.wl-clipboard # Clipboard
pkgs.font-awesome # Fonts
pkgs.libinput-gestures # Gesture Control
pkgs.playerctl # Control sublime-music from waybar?
pkgs.pavucontrol # Pulse Audio Volume CONTROL
pkgs.glib # Set GTK theme settings
pkgs.greetd.tuigreet # Greeter
pkgs.swayidle # Idle management daemon - Automatic lock screen
pkgs.swayosd # used for on-screen notifications for things like adjusting backlight, volume, etc
pkgs.wlogout # Logout/shutdown/hibernate/lock screen modal UI
2023-08-27 13:07:09 +02:00
pkgs.ranger # TUI file manager
pkgs.xdg-utils # Utilities for better X/Wayland integration
pkgs.bitwarden-cli # Bitwarden for rofi
pkgs.bitwarden-menu # Bitwarden for rofi
pkgs.pulsemixer # TUI Pipewire / volume management
2023-08-28 11:13:36 +02:00
pkgs.calcurse # TUI Calendar app
pkgs.udiskie # Automatic device mounting
2024-01-07 07:21:41 +01:00
pkgs.cava # Audio visualiser
pkgs.pyradio # Internet radio TUI
2023-08-27 13:12:19 +02:00
# Themes
pkgs.gruvbox-gtk-theme # Gruvbox Theme
pkgs.papirus-icon-theme # Papirus Icons
# wayland-packages
inputs.nixpkgs-wayland.packages.${platform}.wayprompt # from nixpkgs-wayland exclusively - pinentry UI
2023-08-27 12:38:34 +02:00
];
2023-08-27 12:35:58 +02:00
# Enable sound with pipewire.
sound.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
2023-08-24 02:56:55 +02:00
}