From 307bf69d865f320ffa33034d0a603a28d6794f86 Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Mon, 4 Aug 2025 10:21:35 +0530 Subject: [PATCH] feat: use device.is "name" instead of device.hasGui for most items --- home/apps/default.nix | 2 +- home/apps/foot.nix | 2 +- home/auth.nix | 2 +- home/programs/fish.nix | 12 ++++++------ home/services/eww.nix | 2 +- home/services/gtk.nix | 13 +++++-------- home/services/hyprland.nix | 10 +++++----- home/services/ironbar/default.nix | 2 +- nixos/tsuba/configuration.nix | 2 +- nixos/tsuba/services/caddy.nix | 2 +- 10 files changed, 23 insertions(+), 26 deletions(-) diff --git a/home/apps/default.nix b/home/apps/default.nix index f507a9d7..d6627347 100644 --- a/home/apps/default.nix +++ b/home/apps/default.nix @@ -3,7 +3,7 @@ device, ... }: -lib.optionalAttrs device.hasGui { +lib.optionalAttrs (device.is "ryu") { imports = [ # ./audacity.nix ./blueman.nix diff --git a/home/apps/foot.nix b/home/apps/foot.nix index 28563692..e1f1d2fc 100644 --- a/home/apps/foot.nix +++ b/home/apps/foot.nix @@ -4,7 +4,7 @@ ... }: { programs.foot = { - enable = device.hasGui && pkgs.stdenv.isLinux; + enable = device.is "ryu"; server.enable = true; settings = { main = { diff --git a/home/auth.nix b/home/auth.nix index 2fff4cdb..11b553c5 100644 --- a/home/auth.nix +++ b/home/auth.nix @@ -9,7 +9,7 @@ programs = { _1password-shell-plugins = { # enable 1Password shell plugins for bash, zsh, and fish shell - enable = device.hasGui; + enable = device.is "ryu"; # the specified packages as well as 1Password CLI will be # automatically installed and configured to use shell plugins # plugins = with pkgs; [awscli2 cachix cargo]; diff --git a/home/programs/fish.nix b/home/programs/fish.nix index 9563c2e4..908c0bce 100644 --- a/home/programs/fish.nix +++ b/home/programs/fish.nix @@ -2,6 +2,7 @@ pkgs, lib, device, + config, ... }: { programs.fish = { @@ -36,12 +37,11 @@ ${pkgs.pfetch-rs}/bin/pfetch ${pkgs.nb}/bin/nb todo undone ${lib.optionalString (device.isLinux && !device.isNix) "source /etc/profile.d/nix-daemon.fish"} - ${lib.optionalString (device.isNix && device.hasGui) - '' - if not set -q HYPRLAND_INSTANCE_SIGNATURE - set -x HYPRLAND_INSTANCE_SIGNATURE (hyprctl instances | head -1 | cut -d ' ' -f2 | tr -d :) - end - ''} + ${lib.optionalString (device.is "ryu") '' + if not set -q HYPRLAND_INSTANCE_SIGNATURE + set -x HYPRLAND_INSTANCE_SIGNATURE (hyprctl instances | head -1 | cut -d ' ' -f2 | tr -d :) + end + ''} ''; }; } diff --git a/home/services/eww.nix b/home/services/eww.nix index 3713d2df..d88a9c02 100644 --- a/home/services/eww.nix +++ b/home/services/eww.nix @@ -12,7 +12,7 @@ }; in { programs.eww = { - enable = device.hasGui && pkgs.stdenv.isLinux; + enable = device.is "ryu"; enableFishIntegration = true; configDir = activate_linux; }; diff --git a/home/services/gtk.nix b/home/services/gtk.nix index 4f9a3755..03c93320 100644 --- a/home/services/gtk.nix +++ b/home/services/gtk.nix @@ -5,7 +5,7 @@ ... }: { gtk = { - enable = device.hasGui && pkgs.stdenv.isLinux; + enable = device.is "ryu"; theme = { name = "catppuccin-mocha-mauve-standard+normal"; package = pkgs.catppuccinThemes.gtk; @@ -33,11 +33,8 @@ gtk3.extraConfig = {gtk-application-prefer-dark-theme = 1;}; gtk4.extraConfig = {gtk-application-prefer-dark-theme = 1;}; }; - home.packages = - lib.optionals - (device.hasGui - && pkgs.stdenv.isLinux) [ - # pkgs.catppuccinThemes.gtk - pkgs.catppuccinThemes.papirus-folders - ]; + home.packages = lib.optionals (device.is "ryu") [ + # pkgs.catppuccinThemes.gtk + pkgs.catppuccinThemes.papirus-folders + ]; } diff --git a/home/services/hyprland.nix b/home/services/hyprland.nix index cfc8a146..da0079c8 100644 --- a/home/services/hyprland.nix +++ b/home/services/hyprland.nix @@ -12,7 +12,7 @@ # services.hyprpolkitagent.enable = true; services.hypridle = { - enable = device.hasGui && pkgs.stdenv.isLinux; + enable = device.is "ryu"; settings = { general = { after_sleep_cmd = "hyprctl dispatch dpms on"; @@ -27,12 +27,12 @@ }; }; services.hyprsunset = { - enable = device.hasGui && pkgs.stdenv.isLinux; + enable = device.is "ryu"; }; programs.hyprpaper = let wallpapers = import ../../utils/wallhaven.nix {inherit pkgs;}; in { - enable = device.hasGui && pkgs.stdenv.isLinux; + enable = device.is "ryu"; # enable = true; systemd.enable = true; systemd.target = "hyprland-session.target"; @@ -44,10 +44,10 @@ }; }; programs.hyprlock = { - enable = device.hasGui && pkgs.stdenv.isLinux; + enable = device.is "ryu"; }; wayland.windowManager.hyprland = { - enable = device.hasGui && pkgs.stdenv.isLinux; + enable = device.is "ryu"; systemd.enable = true; settings = { diff --git a/home/services/ironbar/default.nix b/home/services/ironbar/default.nix index 2dd6e1db..eec00a70 100644 --- a/home/services/ironbar/default.nix +++ b/home/services/ironbar/default.nix @@ -6,7 +6,7 @@ }: { imports = [inputs.ironbar.homeManagerModules.default]; programs.ironbar = { - enable = device.hasGui && pkgs.stdenv.isLinux; + enable = device.is "ryu"; package = inputs.ironbar.packages.${pkgs.system}.default; systemd = true; config.monitors = { diff --git a/nixos/tsuba/configuration.nix b/nixos/tsuba/configuration.nix index 560eb349..c616873d 100644 --- a/nixos/tsuba/configuration.nix +++ b/nixos/tsuba/configuration.nix @@ -9,6 +9,7 @@ virtualisation.oci-containers.backend = "docker"; users.extraUsers.servius.extraGroups = ["docker"]; networking.firewall.enable = false; + services.openssh.enable = true; nixpkgs.config.allowUnfree = true; security.sudo.wheelNeedsPassword = false; @@ -66,6 +67,5 @@ }; users.groups.media = {}; system.stateVersion = "25.05"; - services.openssh.enable = true; time.timeZone = "Asia/Kolkata"; } diff --git a/nixos/tsuba/services/caddy.nix b/nixos/tsuba/services/caddy.nix index 3f12671d..7cfabcfa 100644 --- a/nixos/tsuba/services/caddy.nix +++ b/nixos/tsuba/services/caddy.nix @@ -25,7 +25,7 @@ } (auth) { forward_auth https://auth.darksailor.dev { - header_up X-Forwarded-Host {upstream_hostport} + # header_up X-Forwarded-Host {upstream_hostport} uri /api/authz/forward-auth copy_headers Remote-User Remote-Groups Remote-Email Remote-Name }