From d0dc70b0119295e90ea87de6b715c0cdfe133b51 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Fri, 6 Sep 2024 02:33:45 +0200 Subject: [PATCH] add hyprland module, add more base configuration --- home/common/programs/default.nix | 2 +- home/laptop/hyprland/default.nix | 9 ++++--- hosts/common/hyprland.nix | 11 --------- hosts/common/stylix.nix | 41 ++++++++++++++++++++++++++++++++ hosts/common/system/cachix.nix | 7 ------ hosts/common/system/default.nix | 1 - hosts/vamos/default.nix | 10 ++------ modules/default.nix | 1 + modules/hyprland.nix | 23 ++++++++++++++++++ 9 files changed, 74 insertions(+), 31 deletions(-) delete mode 100644 hosts/common/hyprland.nix create mode 100644 hosts/common/stylix.nix delete mode 100644 hosts/common/system/cachix.nix create mode 100644 modules/hyprland.nix diff --git a/home/common/programs/default.nix b/home/common/programs/default.nix index 43c968b..2e87f02 100644 --- a/home/common/programs/default.nix +++ b/home/common/programs/default.nix @@ -3,7 +3,7 @@ _: imports = [ ./git.nix ./gnupg.nix - # ./wezterm.nix + ./wezterm.nix ./nixvim ./browsers.nix ./miscellaneous.nix diff --git a/home/laptop/hyprland/default.nix b/home/laptop/hyprland/default.nix index f554c69..80e3a7e 100644 --- a/home/laptop/hyprland/default.nix +++ b/home/laptop/hyprland/default.nix @@ -1,13 +1,16 @@ { inputs, pkgs, ... }: { + imports = [ + ./waybar.nix + ]; wayland.windowManager.hyprland = { enable = true; - package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; settings = { "$mod" = "SUPER"; - "$terminal" = "wezterm"; + "$terminal" = "kitty"; "$menu" = "fuzzel"; - "monitor" = "eDP-1, 2256x1504@60, 0x0, 1.5"; + "monitor" = "eDP-1, 2256x1504@60, 0x0, 1.6"; input.touchpad.natural_scroll = true; gestures.workspace_swipe = true; xwayland.force_zero_scaling = true; diff --git a/hosts/common/hyprland.nix b/hosts/common/hyprland.nix deleted file mode 100644 index fdc6fee..0000000 --- a/hosts/common/hyprland.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ inputs, pkgs, ... }: -{ - - wayland.windowManager.hyprland = { - enable = true; - # set the flake package - package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; - # make sure to also set the portal package, so that they are in sync - portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; - }; -} diff --git a/hosts/common/stylix.nix b/hosts/common/stylix.nix new file mode 100644 index 0000000..3bce4d8 --- /dev/null +++ b/hosts/common/stylix.nix @@ -0,0 +1,41 @@ +{ pkgs, lib, ... }: + +{ + stylix.enable = true; + stylix.polarity = "dark"; + stylix.image = lib.mkDefault ../../wallpapers/nix-wallpaper-nineish-catppuccin-frappe.svg; + stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-frappe.yaml"; + stylix.autoEnable = true; + + stylix.cursor = { + name = "Adwaita"; + package = pkgs.adwaita-icon-theme; + size = 24; + }; + stylix.fonts = { + serif = { + package = pkgs.noto-fonts; + name = "Noto Serif"; + }; + sansSerif = { + package = pkgs.noto-fonts; + name = "Noto Sans"; + }; + monospace = { + package = pkgs.intel-one-mono; + name = "Intel One Mono"; + }; + emoji = { + package = pkgs.noto-fonts-color-emoji; + name = "Noto Color Emoji"; + }; + sizes = { + terminal = 13; + applications = 11; + desktop = 13; + }; + }; + fonts.packages = [ + pkgs.material-design-icons + ]; +} diff --git a/hosts/common/system/cachix.nix b/hosts/common/system/cachix.nix deleted file mode 100644 index 11cee14..0000000 --- a/hosts/common/system/cachix.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - nix.settings = { - substituters = ["https://hyprland.cachix.org"]; - trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; - }; -} diff --git a/hosts/common/system/default.nix b/hosts/common/system/default.nix index f5b06f7..643e19e 100644 --- a/hosts/common/system/default.nix +++ b/hosts/common/system/default.nix @@ -8,7 +8,6 @@ _: ./packages.nix ./printing.nix ./misc.nix - ./cachix.nix ./nh.nix ]; } diff --git a/hosts/vamos/default.nix b/hosts/vamos/default.nix index e918f43..c8c7103 100644 --- a/hosts/vamos/default.nix +++ b/hosts/vamos/default.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, ... }: +{ inputs, ... }: { imports = [ ./hardware-configuration.nix @@ -21,12 +21,6 @@ }; }; }; - programs.hyprland = { - enable = true; - # set the flake package - package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; - # make sure to also set the portal package, so that they are in sync - portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; - }; + modules.hyprland.enable = true; } diff --git a/modules/default.nix b/modules/default.nix index dcf66f6..9c684a2 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -7,5 +7,6 @@ _: ./gnome.nix ./gaming.nix ./stylix.nix + ./hyprland.nix ]; } diff --git a/modules/hyprland.nix b/modules/hyprland.nix new file mode 100644 index 0000000..7d83e9e --- /dev/null +++ b/modules/hyprland.nix @@ -0,0 +1,23 @@ +{ config, inputs, pkgs, lib, ... }: +let + cfg = config.modules.hyprland; +in + { + options = { + modules.hyprland = { + enable = lib.mkEnableOption "Enable the hyprland module"; + }; + }; + config = lib.mkIf cfg.enable { + nix.settings = { + substituters = ["https://hyprland.cachix.org"]; + trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; + }; + + programs.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; + }; + }; +}