Major config overhaul: use custom modules, setup for multi-host config, and less boilerplate
This commit is contained in:
98
modules/system/hyprland/default.nix
Normal file
98
modules/system/hyprland/default.nix
Normal file
@@ -0,0 +1,98 @@
|
||||
{ inputs, pkgs, pkgs-stable, config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.systemSettings.hyprland;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
systemSettings.hyprland = {
|
||||
enable = lib.mkEnableOption "Enable hyprland";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Hyprland
|
||||
programs = {
|
||||
hyprland = {
|
||||
enable = true;
|
||||
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
||||
xwayland = {
|
||||
enable = true;
|
||||
};
|
||||
portalPackage = pkgs.xdg-desktop-portal-hyprland;
|
||||
};
|
||||
};
|
||||
|
||||
# Necessary packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
jq
|
||||
(sddm-chili-theme.override {
|
||||
themeConfig = {
|
||||
background = config.stylix.image;
|
||||
ScreenWidth = 1920;
|
||||
ScreenHeight = 1080;
|
||||
blur = true;
|
||||
recursiveBlurLoops = 3;
|
||||
recursiveBlurRadius = 5;
|
||||
# TODO fix icons with svgs patched from stylix colors
|
||||
};})
|
||||
];
|
||||
|
||||
# Display manager
|
||||
services.xserver.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
enableHidpi = true;
|
||||
theme = "chili";
|
||||
package = pkgs.sddm;
|
||||
};
|
||||
|
||||
# xwayland
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
xkb = {
|
||||
layout = "us";
|
||||
variant = "";
|
||||
options = "caps:escape";
|
||||
};
|
||||
excludePackages = [ pkgs.xterm ];
|
||||
};
|
||||
|
||||
# Keyring
|
||||
security.pam.services.login.enableGnomeKeyring = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
# Dbus
|
||||
services.dbus = {
|
||||
enable = true;
|
||||
packages = [ pkgs.dconf ];
|
||||
};
|
||||
|
||||
programs.dconf.enable = true;
|
||||
|
||||
# Pipewire
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
|
||||
# Some fancy fonts
|
||||
fonts.packages = with pkgs-stable; [
|
||||
# Fonts
|
||||
nerdfonts
|
||||
powerline
|
||||
];
|
||||
|
||||
# Auto rotate screen
|
||||
programs.iio-hyprland = {
|
||||
enable = true;
|
||||
package = pkgs.iio-hyprland.overrideAttrs {
|
||||
patches = [ ./iio-hyprland-hyprpaper.patch ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
12
modules/system/hyprland/iio-hyprland-hyprpaper.patch
Normal file
12
modules/system/hyprland/iio-hyprland-hyprpaper.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/main.c b/main.c
|
||||
index 2e858dd..2cd43e8 100644
|
||||
--- a/main.c
|
||||
+++ b/main.c
|
||||
@@ -123,6 +123,7 @@ void handle_orientation(enum Orientation orientation, const char* monitor_id) {
|
||||
system_fmt("hyprctl --batch \"keyword monitor %s,transform,%d ; keyword input:touchdevice:transform %d ; keyword input:tablet:transform %d\"", output, orientation, orientation, orientation);
|
||||
|
||||
}
|
||||
+ system_fmt("pkill hyprpaper; hyprpaper & disown;");
|
||||
}
|
||||
|
||||
DBusMessage* request_orientation(DBusConnection* conn) {
|
Reference in New Issue
Block a user