keepbook: install dioxus desktop app

This commit is contained in:
2026-05-05 22:58:35 -07:00
parent fa28f4c433
commit def5b968e2
3 changed files with 383 additions and 359 deletions

18
nixos/flake.lock generated
View File

@@ -278,11 +278,11 @@
"rust-analyzer-src": "rust-analyzer-src_2"
},
"locked": {
"lastModified": 1769842381,
"narHash": "sha256-0dPzo1ElvAIZ0RwEwx5FfqAUiFj22K9QJOU9stiMCrw=",
"lastModified": 1777708550,
"narHash": "sha256-Qif3UXT0l5OQq8H9pRWt4/ia4gF48MWK2oHKL8uVx8U=",
"owner": "nix-community",
"repo": "fenix",
"rev": "b2344f384a82db1410ab09769eb8c4a820de667f",
"rev": "74c1591efaff494756b8d35ebe357c6c2bbdca96",
"type": "github"
},
"original": {
@@ -1217,11 +1217,11 @@
]
},
"locked": {
"lastModified": 1777742447,
"narHash": "sha256-NXU/DH7YmgJ8C3vdcQqxP1TfI9vBeJiN46pAp/OuaCg=",
"lastModified": 1778046887,
"narHash": "sha256-np9C++JA/OgdiPBIkLwRmpEGS8YKDzxs6hy2dn5buPw=",
"owner": "colonelpanic8",
"repo": "keepbook",
"rev": "f5ae6de3d4145410df90ffb291b297cf12ad1067",
"rev": "8cf913fd43270da40034a90fe81019b39cba76da",
"type": "github"
},
"original": {
@@ -1838,11 +1838,11 @@
"rust-analyzer-src_2": {
"flake": false,
"locked": {
"lastModified": 1769786006,
"narHash": "sha256-ax6cH54Nc20QuxlHNC8RMt1P8quMECY4gaACFAdd5ec=",
"lastModified": 1777639980,
"narHash": "sha256-6d7Hdurvbjc5uwJuc0YiK7rZBGj6Gs3uzfBFcTs+xCc=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "eb0588812b041ebbf2645555f2a4df3bcd853c6d",
"rev": "64cdaeb06f69b6b769a492edd88b022ae88e8ca2",
"type": "github"
},
"original": {

View File

@@ -245,7 +245,6 @@
url = "github:noctalia-dev/noctalia-shell";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
@@ -266,10 +265,10 @@
...
}: let
# Nixpkgs PR patches - just specify PR number and hash
nixpkgsPRPatches = [ ];
nixpkgsPRPatches = [];
# Custom patches that don't fit the PR template
nixpkgsCustomPatches = [ ];
nixpkgsCustomPatches = [];
# Home-manager PR patches - just specify PR number and hash
homeManagerPRPatches = [
@@ -328,7 +327,7 @@
builtins.listToAttrs (map mkConfigurationParams machineFilenames);
# Build org-agenda-api container for a given system
mkOrgAgendaApiContainerInfo = system: let
pkgs = import nixpkgs { inherit system; };
pkgs = import nixpkgs {inherit system;};
orgApiRev = builtins.substring 0 7 (org-agenda-api.rev or "unknown");
dotfilesRev = builtins.substring 0 7 (self.rev or self.dirtyRev or "dirty");
dotfilesOrgApi = import ./org-agenda-api.nix {
@@ -402,9 +401,15 @@
then home-manager.nixosModules.home-manager
else import "${patchedHomeManagerSource}/nixos";
# Create a modified inputs with patched home-manager
patchedInputs = inputs // {
home-manager = inputs.home-manager // {
nixosModules = inputs.home-manager.nixosModules // {
patchedInputs =
inputs
// {
home-manager =
inputs.home-manager
// {
nixosModules =
inputs.home-manager.nixosModules
// {
home-manager = patchedHomeManagerModule;
};
# Also provide the patched source path for any direct imports
@@ -435,7 +440,8 @@
}
// specialArgs;
};
in {
in
{
nixConfig = {
substituters = [
"https://cache.nixos.org/"
@@ -491,9 +497,10 @@
mkConfig (params // machineParams)
)
defaultConfigurationParams;
} // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
}
// flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {inherit system;};
lib = pkgs.lib;
# Get short revs for tagging
@@ -514,10 +521,12 @@
in {
formatter = pkgs.alejandra;
packages = {
packages =
{
colonelpanic-org-agenda-api = containerLib.containers.colonelpanic;
kat-org-agenda-api = containerLib.containers.kat;
} // lib.optionalAttrs pkgs.stdenv.isLinux {
}
// lib.optionalAttrs pkgs.stdenv.isLinux {
hyprNStack = inputs.hyprNStack.packages.${system}.hyprNStack;
hyprexpo-lua = inputs.hyprland-plugins-lua.packages.${system}.hyprexpo;
hyprwinview = inputs.hyprwinview.packages.${system}.hyprwinview;
@@ -529,8 +538,9 @@
hyprexpo-lua = inputs.hyprland-plugins-lua.packages.${system}.hyprexpo;
hyprwinview = inputs.hyprwinview.packages.${system}.hyprwinview;
hypr-workspace-history = inputs.hypr-workspace-history.packages.${system}.hypr-workspace-history;
hyprland-config-syntax = pkgs.runCommand "hyprland-config-syntax" {
nativeBuildInputs = [ pkgs.lua5_4 ];
hyprland-config-syntax =
pkgs.runCommand "hyprland-config-syntax" {
nativeBuildInputs = [pkgs.lua5_4];
} ''
cp ${../dotfiles/config/hypr/hyprland.lua} hyprland.lua
luac -p hyprland.lua
@@ -654,7 +664,8 @@
hyprland-verify-config = let
hyprlandPackage = inputs.hyprland.packages.${system}.hyprland;
hyprNStackPackage = inputs.hyprNStack.packages.${system}.hyprNStack;
in pkgs.runCommand "hyprland-lua-verify-config" {} ''
in
pkgs.runCommand "hyprland-lua-verify-config" {} ''
cp ${../dotfiles/config/hypr/hyprland.lua} hyprland.lua
substituteInPlace hyprland.lua \
--replace-fail /run/current-system/sw/lib/libhyprNStack.so \

View File

@@ -1,53 +1,67 @@
{ config, lib, pkgs, inputs, makeEnable, ... }:
let
{
config,
lib,
pkgs,
inputs,
makeEnable,
...
}: let
cfg = config.myModules."keepbook-sync";
keepbookTray =
inputs.keepbook.packages.${pkgs.stdenv.hostPlatform.system}.keepbook-tray.overrideAttrs (_: {
keepbookPackages = inputs.keepbook.packages.${pkgs.stdenv.hostPlatform.system};
keepbookTray = keepbookPackages.keepbook-tray.overrideAttrs (_: {
# Upstream currently includes a contract test that expects a built TS CLI
# entrypoint under ts/dist/, but the Nix build does not build the TS
# artifacts first. Skip checks to keep the package usable on NixOS.
doCheck = false;
});
keepbookDioxusDesktopPackages =
lib.optional (keepbookPackages ? keepbook-dioxus-desktop)
keepbookPackages.keepbook-dioxus-desktop;
daemonArgs = [
"--config" cfg.configPath
"--interval" cfg.interval
"--jitter" cfg.jitter
daemonArgs =
[
"--config"
cfg.configPath
"--interval"
cfg.interval
"--jitter"
cfg.jitter
]
++ lib.optionals (cfg.historyPoints != null) [ "--history-points" (toString cfg.historyPoints) ]
++ lib.optionals (!cfg.syncOnStart) [ "--no-sync-on-start" ]
++ lib.optionals (!cfg.syncPrices) [ "--no-sync-prices" ]
++ lib.optionals (!cfg.syncSymlinks) [ "--no-sync-symlinks" ]
++ lib.optionals (cfg.balanceStaleness != null) [ "--balance-staleness" cfg.balanceStaleness ]
++ lib.optionals (cfg.priceStaleness != null) [ "--price-staleness" cfg.priceStaleness ];
++ lib.optionals (cfg.historyPoints != null) ["--history-points" (toString cfg.historyPoints)]
++ lib.optionals (!cfg.syncOnStart) ["--no-sync-on-start"]
++ lib.optionals (!cfg.syncPrices) ["--no-sync-prices"]
++ lib.optionals (!cfg.syncSymlinks) ["--no-sync-symlinks"]
++ lib.optionals (cfg.balanceStaleness != null) ["--balance-staleness" cfg.balanceStaleness]
++ lib.optionals (cfg.priceStaleness != null) ["--price-staleness" cfg.priceStaleness];
daemonExec = lib.escapeShellArgs ([ "${keepbookTray}/bin/keepbook-sync-daemon" ] ++ daemonArgs);
daemonExec = lib.escapeShellArgs (["${keepbookTray}/bin/keepbook-sync-daemon"] ++ daemonArgs);
enabledModule = makeEnable config "myModules.keepbook-sync" false {
environment.systemPackages = [ keepbookTray ];
environment.systemPackages = [keepbookTray] ++ keepbookDioxusDesktopPackages;
home-manager.users.${cfg.user} = {
systemd.user.services.keepbook-sync-daemon = {
Unit = {
Description = "keepbook sync daemon";
After = [ "graphical-session.target" "tray.target" ];
PartOf = [ "graphical-session.target" ];
Requires = [ "tray.target" ];
After = ["graphical-session.target" "tray.target"];
PartOf = ["graphical-session.target"];
Requires = ["tray.target"];
};
Service = {
ExecStart = daemonExec;
Restart = "always";
RestartSec = 5;
Environment = [ "RUST_LOG=info" ];
Environment = ["RUST_LOG=info"];
};
Install = {
WantedBy = [ "graphical-session.target" ];
WantedBy = ["graphical-session.target"];
};
};
};
};
in
enabledModule // {
enabledModule
// {
# Merge our extra options with the enable option produced by makeEnable.
options = lib.recursiveUpdate enabledModule.options {
myModules."keepbook-sync" = {
@@ -110,7 +124,6 @@ enabledModule // {
default = null;
description = "Optional override for the maximum recent portfolio history rows shown in the tray menu.";
};
};
};
}
}