From e2272d6299e5c08e4b2cadc42eba673354e4e814 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sat, 1 Aug 2026 19:13:03 +0530 Subject: feat: using nixpkgs from the local flake registry, added darkman - Making nixpkgs use the local registry instead of downloading from github from home manager this makes sure that home manager and nixos use the same derivations for any given package - Added darkman and removed gtk for enabling and using dark mode --- modules/desktop/darkman/default.nix | 39 ++++++++++++++++++++++++++++++++++ modules/desktop/default.nix | 4 ++-- modules/desktop/gtk/default.nix | 42 ------------------------------------- modules/desktop/waybar/style.nix | 4 ++++ 4 files changed, 45 insertions(+), 44 deletions(-) create mode 100644 modules/desktop/darkman/default.nix delete mode 100644 modules/desktop/gtk/default.nix (limited to 'modules/desktop') diff --git a/modules/desktop/darkman/default.nix b/modules/desktop/darkman/default.nix new file mode 100644 index 0000000..4aef68d --- /dev/null +++ b/modules/desktop/darkman/default.nix @@ -0,0 +1,39 @@ +# Darkman - Automatic dark/light mode switching based on time of day +{ + config, + lib, + pkgs, + ... +}: +{ + options.desktop.darkman = { + enable = lib.mkEnableOption "Enables darkman automatic dark/light mode switching." // { + default = true; + }; + }; + + config = lib.mkIf (config.desktop.enable && config.desktop.darkman.enable) { + services.darkman = { + enable = true; + settings = { + portal = true; + lat = 0; + lng = 0; + }; + }; + + xdg.portal = { + enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-hyprland ]; + config.common = { + default = [ "hyprland" ]; + "org.freedesktop.impl.portal.Settings" = "darkman"; + }; + }; + + # Always dark by default + home.activation.forceDarkman = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + ${pkgs.darkman}/bin/darkman set dark || true + ''; + }; +} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 27926ec..15ad896 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -1,4 +1,4 @@ -# Desktop - Desktop environment configuration (Hyprland, GTK, waybar) +# Desktop - Desktop environment configuration (Hyprland, darkman, waybar) { lib, config, @@ -6,7 +6,7 @@ }: { imports = [ - ./gtk + ./darkman ./rofi ./xdg ./hyprland diff --git a/modules/desktop/gtk/default.nix b/modules/desktop/gtk/default.nix deleted file mode 100644 index 05a9807..0000000 --- a/modules/desktop/gtk/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -# GTK - GTK3/GTK4 theme configuration (Nightfox dark theme) -{ - config, - lib, - pkgs, - ... -}: -{ - config = lib.mkIf config.desktop.enable { - gtk = { - enable = true; - colorScheme = "dark"; - theme = { - package = pkgs.nightfox-gtk-theme.override { - tweakVariants = [ "carbonfox" ]; - }; - name = "Nightfox-Dark-Carbonfox"; - }; - gtk3.extraConfig = { - gtk-application-prefer-dark-theme = 1; - }; - gtk4.extraConfig = { - gtk-application-prefer-dark-theme = 1; - }; - }; - - gtk.gtk4.theme = config.gtk.theme; - - dconf.settings = { - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - gtk-theme = "Nightfox-Dark-Carbonfox"; - }; - }; - - qt = { - enable = true; - platformTheme.name = "gtk4"; - style.name = "adwaita-dark"; - }; - }; -} diff --git a/modules/desktop/waybar/style.nix b/modules/desktop/waybar/style.nix index 25841d8..4ca496f 100644 --- a/modules/desktop/waybar/style.nix +++ b/modules/desktop/waybar/style.nix @@ -11,6 +11,10 @@ with config.scheme.withHashtag; padding: 0; } + window#waybar { + background: transparent; + } + #workspaces, #window, #pulseaudio, #battery, #network, #clock.time, #custom-usque, #memory, #cpu, #clock.date { background: ${base00}; -- cgit v1.2.3