aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/darkman/default.nix
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-01 19:13:03 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-01 19:13:03 +0530
commite2272d6299e5c08e4b2cadc42eba673354e4e814 (patch)
treecb9541b0cab8224550e4310c65c20e0164d51d62 /modules/desktop/darkman/default.nix
parentd9535cffa21756e37e40eb6b48d56ab37000373c (diff)
downloadhome-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/darkman/default.nix')
-rw-r--r--modules/desktop/darkman/default.nix39
1 files changed, 39 insertions, 0 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
+ '';
+ };
+}