main
  1{ pkgs, ... }:
  2let
  3  # Wrapper for jira-cli that injects API token from passage
  4  jira-wrapped = pkgs.writeShellScriptBin "jira" ''
  5    export JIRA_API_TOKEN=$(${pkgs.passage}/bin/passage show redhat/issues/atlassian/token)
  6    exec ${pkgs.jira-cli-go}/bin/jira "$@"
  7  '';
  8in
  9{
 10  imports = [
 11    ../../home/common/services/usage-metrics.nix
 12    ../../home/common/dev/containers.nix
 13    ../../home/common/dev/gh-news.nix
 14    ../../home/common/dev/github-notif-manager.nix
 15    ../../home/common/dev/lazyworktree.nix
 16    ../../home/common/dev/neovim.nix
 17    ../../home/common/dev/tektoncd.nix
 18    ../../home/common/services/color-scheme-timer.nix
 19    ../../home/common/services/gcal-to-org.nix
 20    ../../home/common/services/goimapnotify.nix
 21    ../../home/common/services/mail-monitor.nix
 22    ../../home/common/services/readwise-sync.nix
 23    ../../home/common/services/redhat.nix
 24    ../../home/common/shell/gh.nix
 25  ];
 26
 27  home.file.".gmailctl/config.jsonnet".source = ./config.jsonnet;
 28  home.file.".gmailctl/gmailctl.libsonnet".source = ./gmailctl.libsonnet;
 29  home.packages = with pkgs; [
 30    # easyeffects # Not using it really
 31
 32    nautilus
 33
 34    slack
 35
 36    gmailctl
 37    gcalcli
 38    nextmeeting
 39
 40    calibre
 41
 42    ntfy-sh
 43    libnotify
 44
 45    monolith
 46
 47    feishin # navidrome - uses mpv-unwrapped via overlay
 48
 49    lazygit
 50
 51    # Keyboard
 52    qmk
 53    qmk_hid
 54
 55    startpaac
 56    abs-tui
 57    batzconverter
 58
 59    simple-scan
 60    keybase
 61
 62    # transmission_4-gtk # Using remote one for now
 63
 64    # forgejo-cli
 65    jira-wrapped
 66
 67    # lisp
 68    # roswell # Disabled: broken in nixpkgs-unstable (register_runtime_options error)
 69    # sbcl # Not using
 70
 71    go-org-readwise
 72    radian
 73    gh-pr
 74    lazypr
 75    nixpkgs-pr-watch
 76    arr
 77    toggle-color-scheme
 78    shpool-remote
 79    cliphist-cleanup
 80
 81    slackdump
 82    tekton-lsp
 83    pi-acp
 84
 85    (pkgs.writeShellScriptBin "officemode" ''
 86      echo "80" > /sys/class/power_supply/BAT0/charge_control_end_threshold
 87      echo "70" > /sys/class/power_supply/BAT0/charge_control_start_threshold
 88      echo "Office mode: charging between 70%80%"
 89    '')
 90    (pkgs.writeShellScriptBin "roadmode" ''
 91      echo "100" > /sys/class/power_supply/BAT0/charge_control_end_threshold
 92      echo "0" > /sys/class/power_supply/BAT0/charge_control_start_threshold
 93      echo "Road mode: charging to 100%"
 94    '')
 95    jayrah
 96    jayrat
 97    daily-plan
 98  ];
 99
100  # Automatic color scheme switching
101  services.color-scheme-timer = {
102    enable = true;
103    latitude = "48.87"; # Paris coordinates
104    longitude = "2.33";
105    lightTime = "07:00"; # Switch to light mode at 7am
106    darkTime = "19:00"; # Switch to dark mode at 7pm
107  };
108
109  # Google Calendar sync to org-mode
110  services.gcal-to-org = {
111    enable = true;
112    interval = "hourly";
113  };
114
115  # Readwise sync to org-mode
116  services.readwise-sync = {
117    enable = true;
118    interval = "daily";
119  };
120
121  # ntfy notification subscriber
122  # disabled: auth token expired, causes fail2ban bans from 401 retry floods
123  # systemd.user.services.ntfy-subscriber = {
124  #   Unit = {
125  #     Description = "ntfy notification subscriber";
126  #     Documentation = "https://ntfy.sh";
127  #     After = [
128  #       "graphical-session.target"
129  #       "network-online.target"
130  #     ];
131  #     Wants = [ "network-online.target" ];
132  #   };
133  #
134  #   Service = {
135  #     Type = "simple";
136  #     ExecStart = "${pkgs.ntfy-sh}/bin/ntfy subscribe --from-config";
137  #     Restart = "on-failure";
138  #     RestartSec = 10;
139  #     Environment = [
140  #       "PATH=${pkgs.bash}/bin:${pkgs.coreutils}/bin:${pkgs.libnotify}/bin:${pkgs.ntfy-sh}/bin:${pkgs.xdg-utils}/bin:${pkgs.curl}/bin:${pkgs.passage}/bin"
141  #       "PASSAGE_DIR=/home/vincent/.local/share/passage"
142  #       "PASSAGE_IDENTITIES_FILE=/home/vincent/.local/share/passage/identities"
143  #     ];
144  #   };
145  #
146  #   Install = {
147  #     WantedBy = [ "graphical-session.target" ];
148  #   };
149  # };
150
151}