From bb08c527902c3b81e9f5b1e42f4c70963f92f7e6 Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Mon, 29 Sep 2025 21:19:38 -0600 Subject: [PATCH] hyprland safe escape with stylix + fonts flake --- config/stylix.nix | 5 +++-- environments/hyprland.nix | 4 ++-- flake.lock | 17 +++++++++++++++++ flake.nix | 4 ++++ modules/apps/fonts.nix | 17 +++++++++++++++++ 5 files changed, 43 insertions(+), 4 deletions(-) diff --git a/config/stylix.nix b/config/stylix.nix index c6154aa..bc237db 100644 --- a/config/stylix.nix +++ b/config/stylix.nix @@ -11,6 +11,7 @@ let }; scheme = schemesFile.schemes.cheems; cfg = config.my.stylix; + gnomeEnabled = config.services.xserver.desktopManager.gnome.enable; in { options.my.stylix.enable = lib.mkEnableOption "system-wide theming with Stylix"; @@ -23,7 +24,7 @@ in } // lib.optionalAttrs (scheme ? base16Scheme) { inherit (scheme) base16Scheme; }; home-manager.users.jawz = { - gtk = lib.mkIf (!cfg.enable) { + gtk = lib.mkIf (!cfg.enable && gnomeEnabled) { enable = true; iconTheme = { name = "Papirus-Light"; @@ -33,7 +34,7 @@ in }; }; stylix = { - enable = true; + inherit (cfg) enable; autoEnable = cfg.enable; iconTheme = { inherit (cfg) enable; diff --git a/environments/hyprland.nix b/environments/hyprland.nix index 1abdd05..17c33c6 100644 --- a/environments/hyprland.nix +++ b/environments/hyprland.nix @@ -22,7 +22,7 @@ in enable = true; extraPortals = [ pkgs.xdg-desktop-portal-hyprland - pkgs.xdg-desktop-portal-gtk + # pkgs.xdg-desktop-portal-gtk ]; }; users.users.jawz.packages = builtins.attrValues { @@ -37,7 +37,7 @@ in mako # Notification daemon libnotify # dependency of mako swaylock-effects # Screen locker - nautilus # File manager + # nautilus # File manager ; }; home-manager.users.jawz = { diff --git a/flake.lock b/flake.lock index f40c545..769fd6d 100644 --- a/flake.lock +++ b/flake.lock @@ -304,6 +304,22 @@ "type": "github" } }, + "fonts": { + "flake": false, + "locked": { + "lastModified": 1759200391, + "narHash": "sha256-S5LwvPL7sKgwKUhCyTpcuWUxCq57RFh7wbZ6rIc5AgU=", + "ref": "refs/heads/master", + "rev": "edea9d2aaf2f4e0481fbbb8e26f68a9f39248e3f", + "revCount": 2, + "type": "git", + "url": "https://git.servidos.lat/jawz/fonts.git" + }, + "original": { + "type": "git", + "url": "https://git.servidos.lat/jawz/fonts.git" + } + }, "fromYaml": { "flake": false, "locked": { @@ -910,6 +926,7 @@ "root": { "inputs": { "doom-emacs": "doom-emacs", + "fonts": "fonts", "home-manager": "home-manager", "hyprland": "hyprland", "jawz-scripts": "jawz-scripts", diff --git a/flake.nix b/flake.nix index 33d7261..056a480 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,10 @@ url = "git+https://git.servidos.lat/jawz/wallpapers.git"; flake = false; }; + fonts = { + url = "git+https://git.servidos.lat/jawz/fonts.git"; + flake = false; + }; nur = { url = "github:nix-community/nur"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/apps/fonts.nix b/modules/apps/fonts.nix index 7fc0c18..3e72cdf 100644 --- a/modules/apps/fonts.nix +++ b/modules/apps/fonts.nix @@ -2,13 +2,30 @@ config, lib, pkgs, + inputs, ... }: +let + customFonts = pkgs.stdenvNoCC.mkDerivation { + name = "custom-fonts"; + src = inputs.fonts; + installPhase = '' + mkdir -p $out/share/fonts + find $src -type f \( \ + -name "*.ttf" -o \ + -name "*.otf" -o \ + -name "*.woff" -o \ + -name "*.woff2" \ + \) -exec cp {} $out/share/fonts/ \; + ''; + }; +in { options.my.apps.fonts.enable = lib.mkEnableOption "additional fonts and typography"; config = lib.mkIf config.my.apps.fonts.enable { nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "corefonts" ]; fonts.packages = builtins.attrValues { + inherit customFonts; inherit (pkgs) symbola comic-neue