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    jayrat
120    daily-plan
121  ];
122
123  # Automatic color scheme switching
124  services.color-scheme-timer = {
125    enable = true;
126    latitude = "48.87"; # Paris coordinates
127    longitude = "2.33";
128    lightTime = "07:00"; # Switch to light mode at 7am
129    darkTime = "19:00"; # Switch to dark mode at 7pm
130  };
131
132  # Google Calendar sync to org-mode
133  services.gcal-to-org = {
134    enable = true;
135    interval = "hourly";
136  };
137
138  # Readwise sync to org-mode
139  services.readwise-sync = {
140    enable = true;
141    interval = "daily";
142  };
143
144  # Readwise Reader triage report
145  services.readwise-reader = {
146    enable = true;
147    model = "opus";
148    interval = "daily";
149    serve = {
150      enable = true;
151      port = 8880;
152    };
153  };
154
155  # ntfy notification subscriber
156  # disabled: auth token expired, causes ~7k retry log lines per boot
157  # systemd.user.services.ntfy-subscriber = {
158  #   Unit = {
159  #     Description = "ntfy notification subscriber";
160  #     Documentation = "https://ntfy.sh";
161  #     After = [
162  #       "graphical-session.target"
163  #       "network-online.target"
164  #     ];
165  #     Wants = [ "network-online.target" ];
166  #   };
167  #
168  #   Service = {
169  #     Type = "simple";
170  #     ExecStart = "${pkgs.ntfy-sh}/bin/ntfy subscribe --from-config";
171  #     Restart = "on-failure";
172  #     RestartSec = 10;
173  #     Environment = [
174  #       "PATH=${pkgs.bash}/bin:${pkgs.coreutils}/bin:${pkgs.libnotify}/bin:${pkgs.ntfy-sh}/bin:${pkgs.xdg-utils}/bin:${pkgs.curl}/bin:${pkgs.passage}/bin"
175  #       "PASSAGE_DIR=/home/vincent/.local/share/passage"
176  #       "PASSAGE_IDENTITIES_FILE=/home/vincent/.ssh/id_ed25519"
177  #     ];
178  #   };
179  #
180  #   Install = {
181  #     WantedBy = [ "graphical-session.target" ];
182  #   };
183  # };
184}