main
  1{
  2  pkgs,
  3  lib,
  4  inputs,
  5  system,
  6  ...
  7}:
  8let
  9  # Wrapper for jira-cli that injects API token from passage
 10  jira-wrapped = pkgs.writeShellScriptBin "jira" ''
 11    export JIRA_API_TOKEN=$(${pkgs.passage}/bin/passage show redhat/issues/atlassian/token)
 12    exec ${pkgs.jira-cli-go}/bin/jira "$@"
 13  '';
 14in
 15{
 16  imports = [
 17    ../../home/common/services/usage-metrics.nix
 18    ../../home/common/dev/containers.nix
 19    ../../home/common/dev/gh-news.nix
 20    ../../home/common/dev/github-notif-manager.nix
 21    ../../home/common/dev/lazyworktree.nix
 22    ../../home/common/dev/neovim.nix
 23    ../../home/common/dev/tektoncd.nix
 24    ../../home/common/services/color-scheme-timer.nix
 25    ../../home/common/services/gcal-to-org.nix
 26    ../../home/common/services/goimapnotify.nix
 27    ../../home/common/services/mail-monitor.nix
 28    ../../home/common/services/readwise-reader.nix
 29    ../../home/common/services/readwise-sync.nix
 30    ../../home/common/services/redhat.nix
 31    ../../home/common/shell/gh.nix
 32  ];
 33
 34  # Kanshi output profiles for okinawa (HDMI on dGPU)
 35  services.kanshi.settings = [
 36    {
 37      profile.name = "okinawa-hdmi";
 38      profile.outputs = [
 39        {
 40          criteria = "eDP-2";
 41          status = "disable";
 42        }
 43        {
 44          criteria = "LG Electronics LG ULTRAWIDE 0x0005D10C";
 45          status = "enable";
 46          position = "0,0";
 47          mode = "3440x1440";
 48          scale = 1.0;
 49        }
 50      ];
 51    }
 52    {
 53      profile.name = "okinawa-undocked";
 54      profile.outputs = [
 55        {
 56          criteria = "eDP-2";
 57          status = "enable";
 58          position = "0,0";
 59          mode = "1920x1200";
 60          scale = 1.0;
 61        }
 62      ];
 63    }
 64  ];
 65
 66  # llama-cpp defaults for RX 6700S (RDNA2)
 67  # Flash attention crashes on gfx1030 ROCm: GGML_ASSERT(max_blocks_per_sm > 0)
 68  home.sessionVariables = {
 69    LLAMA_ARG_FLASH_ATTN = "off";
 70    LLAMA_ARG_MAIN_GPU = "0";
 71    # Use TPM + Yubikey identities for passage (set in home/common/desktop/passage.nix)
 72  };
 73
 74  # Use Vulkan variant for GPU-accelerated transcription (RX 6700S / RDNA2)
 75  programs.voxtype.package = lib.mkForce inputs.voxtype.packages.${system}.vulkan;
 76
 77  home.packages = with pkgs; [
 78    nautilus
 79
 80    slack
 81
 82    libreoffice
 83
 84    calibre
 85
 86    ntfy-sh
 87    libnotify
 88
 89    monolith
 90
 91    feishin # navidrome - uses mpv-unwrapped via overlay
 92
 93    lazygit
 94
 95    # Keyboard
 96    qmk
 97    qmk_hid
 98
 99    startpaac
100    abs-tui
101    batzconverter
102
103    simple-scan
104
105    jira-wrapped
106
107    go-org-readwise
108    radian
109    gh-pr
110    lazypr
111    nixpkgs-pr-watch
112    arr
113    toggle-color-scheme
114    shpool-remote
115    cliphist-cleanup
116
117    ssh-to-age
118
119    jayrah
120    jayrat
121    daily-plan
122  ];
123
124  # Automatic color scheme switching
125  services.color-scheme-timer = {
126    enable = true;
127    latitude = "48.87"; # Paris coordinates
128    longitude = "2.33";
129    lightTime = "07:00"; # Switch to light mode at 7am
130    darkTime = "19:00"; # Switch to dark mode at 7pm
131  };
132
133  # Google Calendar sync to org-mode
134  services.gcal-to-org = {
135    enable = true;
136    interval = "hourly";
137  };
138
139  # Readwise sync to org-mode
140  services.readwise-sync = {
141    enable = true;
142    interval = "daily";
143  };
144
145  # Readwise Reader triage report
146  services.readwise-reader = {
147    enable = true;
148    model = "opus";
149    interval = "daily";
150    serve = {
151      enable = true;
152      port = 8880;
153    };
154  };
155
156  # ntfy notification subscriber
157  # disabled: auth token expired, causes ~7k retry log lines per boot
158  # systemd.user.services.ntfy-subscriber = {
159  #   Unit = {
160  #     Description = "ntfy notification subscriber";
161  #     Documentation = "https://ntfy.sh";
162  #     After = [
163  #       "graphical-session.target"
164  #       "network-online.target"
165  #     ];
166  #     Wants = [ "network-online.target" ];
167  #   };
168  #
169  #   Service = {
170  #     Type = "simple";
171  #     ExecStart = "${pkgs.ntfy-sh}/bin/ntfy subscribe --from-config";
172  #     Restart = "on-failure";
173  #     RestartSec = 10;
174  #     Environment = [
175  #       "PATH=${pkgs.bash}/bin:${pkgs.coreutils}/bin:${pkgs.libnotify}/bin:${pkgs.ntfy-sh}/bin:${pkgs.xdg-utils}/bin:${pkgs.curl}/bin:${pkgs.passage}/bin"
176  #       "PASSAGE_DIR=/home/vincent/.local/share/passage"
177  #       "PASSAGE_IDENTITIES_FILE=/home/vincent/.ssh/id_ed25519"
178  #     ];
179  #   };
180  #
181  #   Install = {
182  #     WantedBy = [ "graphical-session.target" ];
183  #   };
184  # };
185}