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 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 modules/desktop/darkman/default.nix (limited to 'modules/desktop/darkman/default.nix') 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 + ''; + }; +} -- cgit v1.2.3