nixos/modules/home-manager/darkman.nix

46 lines
1.2 KiB
Nix

{ config, pkgs, lib, ... }:
{
options.modules.darkman = {
enable = lib.mkEnableOption "Darkman service and integration";
customLightModeScript = lib.mkOption {
type = lib.types.str;
description = "Path to custom light mode script";
};
customDarkModeScript = lib.mkOption {
type = lib.types.str;
description = "Path to custom dark mode script";
};
};
config = lib.mkIf config.modules.darkman.enable {
home.packages = with pkgs; [ dconf ];
services.darkman = {
enable = true;
darkModeScripts = {
theme = ''
${pkgs.dconf}/bin/dconf write\
/org/gnome/desktop/interface/color-scheme "'prefer-dark'"
'';
custom = config.modules.darkman.customDarkModeScript;
pywalfox = "command -v pywalfox &>/dev/null && pywalfox dark && pywalfox update";
};
lightModeScripts = {
theme = ''
${pkgs.dconf}/bin/dconf write\
/org/gnome/desktop/interface/color-scheme "'prefer-light'"
'';
custom = config.modules.darkman.customLightModeScript;
pywalfox = "command -v pywalfox &>/dev/null && pywalfox light && pywalfox update";
};
settings.usegeoclue = true;
};
};
}