feat: use device.is "name" instead of device.hasGui for most items

This commit is contained in:
uttarayan21
2025-08-04 10:21:35 +05:30
parent e6ea163b6d
commit 307bf69d86
10 changed files with 23 additions and 26 deletions

View File

@@ -3,7 +3,7 @@
device,
...
}:
lib.optionalAttrs device.hasGui {
lib.optionalAttrs (device.is "ryu") {
imports = [
# ./audacity.nix
./blueman.nix

View File

@@ -4,7 +4,7 @@
...
}: {
programs.foot = {
enable = device.hasGui && pkgs.stdenv.isLinux;
enable = device.is "ryu";
server.enable = true;
settings = {
main = {

View File

@@ -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];

View File

@@ -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
''}
'';
};
}

View File

@@ -12,7 +12,7 @@
};
in {
programs.eww = {
enable = device.hasGui && pkgs.stdenv.isLinux;
enable = device.is "ryu";
enableFishIntegration = true;
configDir = activate_linux;
};

View File

@@ -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
];
}

View File

@@ -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 = {

View File

@@ -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 = {

View File

@@ -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";
}

View File

@@ -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
}