From 9045c7dcd4c8c8bc7d8de09fa42435eda0c04f7d Mon Sep 17 00:00:00 2001
From: Antoine Martin <antoine@alarsyo.net>
Date: Sat, 22 Feb 2025 16:14:32 +0100
Subject: [PATCH] talos: home: setup darkman

---
 hosts/talos/default.nix | 9 +++++++++
 hosts/talos/home.nix    | 7 +++++++
 2 files changed, 16 insertions(+)

diff --git a/hosts/talos/default.nix b/hosts/talos/default.nix
index 1b475c4..422cc56 100644
--- a/hosts/talos/default.nix
+++ b/hosts/talos/default.nix
@@ -158,6 +158,8 @@
 
   environment.systemPackages = [
     pkgs.foot
+    # FIXME: is this needed?
+    pkgs.darkman
   ];
 
   #programs.hyprland.enable = true;
@@ -166,6 +168,13 @@
     wrapperFeatures.gtk = true;
   };
 
+  # TODO: These are overriden by files from
+  # ~/.config/xdg-desktop-portal/sway-portals.conf so they should be moved to
+  # home
+  xdg.portal.config.sway = {
+    "org.freedesktop.impl.portal.Settings" = "darkman";
+  };
+
   # Copy the NixOS configuration file and link it from the resulting system
   # (/run/current-system/configuration.nix). This is useful in case you
   # accidentally delete configuration.nix.
diff --git a/hosts/talos/home.nix b/hosts/talos/home.nix
index 519822a..6c666ad 100644
--- a/hosts/talos/home.nix
+++ b/hosts/talos/home.nix
@@ -35,6 +35,13 @@ in {
           night = 3500;
         };
       };
+      darkman = {
+        enable = true;
+        settings = {
+          lat = 48.9;
+          lng = 2.3;
+        };
+      };
     };
 
     home.packages = builtins.attrValues {