diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-01 19:13:03 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-01 19:13:03 +0530 |
| commit | e2272d6299e5c08e4b2cadc42eba673354e4e814 (patch) | |
| tree | cb9541b0cab8224550e4310c65c20e0164d51d62 /modules/desktop | |
| parent | d9535cffa21756e37e40eb6b48d56ab37000373c (diff) | |
| download | home-manager-config-e2272d6299e5c08e4b2cadc42eba673354e4e814.tar.gz home-manager-config-e2272d6299e5c08e4b2cadc42eba673354e4e814.zip | |
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
Diffstat (limited to 'modules/desktop')
| -rw-r--r-- | modules/desktop/darkman/default.nix | 39 | ||||
| -rw-r--r-- | modules/desktop/default.nix | 4 | ||||
| -rw-r--r-- | modules/desktop/gtk/default.nix | 42 | ||||
| -rw-r--r-- | modules/desktop/waybar/style.nix | 4 |
4 files changed, 45 insertions, 44 deletions
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}; |
