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

View File

@@ -245,7 +245,6 @@
url = "github:noctalia-dev/noctalia-shell"; url = "github:noctalia-dev/noctalia-shell";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = inputs @ { outputs = inputs @ {
@@ -402,9 +401,15 @@
then home-manager.nixosModules.home-manager then home-manager.nixosModules.home-manager
else import "${patchedHomeManagerSource}/nixos"; else import "${patchedHomeManagerSource}/nixos";
# Create a modified inputs with patched home-manager # Create a modified inputs with patched home-manager
patchedInputs = inputs // { patchedInputs =
home-manager = inputs.home-manager // { inputs
nixosModules = inputs.home-manager.nixosModules // { // {
home-manager =
inputs.home-manager
// {
nixosModules =
inputs.home-manager.nixosModules
// {
home-manager = patchedHomeManagerModule; home-manager = patchedHomeManagerModule;
}; };
# Also provide the patched source path for any direct imports # Also provide the patched source path for any direct imports
@@ -435,7 +440,8 @@
} }
// specialArgs; // specialArgs;
}; };
in { in
{
nixConfig = { nixConfig = {
substituters = [ substituters = [
"https://cache.nixos.org/" "https://cache.nixos.org/"
@@ -491,8 +497,9 @@
mkConfig (params // machineParams) mkConfig (params // machineParams)
) )
defaultConfigurationParams; defaultConfigurationParams;
} // flake-utils.lib.eachDefaultSystem (system: }
let // flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {inherit system;}; pkgs = import nixpkgs {inherit system;};
lib = pkgs.lib; lib = pkgs.lib;
@@ -514,10 +521,12 @@
in { in {
formatter = pkgs.alejandra; formatter = pkgs.alejandra;
packages = { packages =
{
colonelpanic-org-agenda-api = containerLib.containers.colonelpanic; colonelpanic-org-agenda-api = containerLib.containers.colonelpanic;
kat-org-agenda-api = containerLib.containers.kat; kat-org-agenda-api = containerLib.containers.kat;
} // lib.optionalAttrs pkgs.stdenv.isLinux { }
// lib.optionalAttrs pkgs.stdenv.isLinux {
hyprNStack = inputs.hyprNStack.packages.${system}.hyprNStack; hyprNStack = inputs.hyprNStack.packages.${system}.hyprNStack;
hyprexpo-lua = inputs.hyprland-plugins-lua.packages.${system}.hyprexpo; hyprexpo-lua = inputs.hyprland-plugins-lua.packages.${system}.hyprexpo;
hyprwinview = inputs.hyprwinview.packages.${system}.hyprwinview; hyprwinview = inputs.hyprwinview.packages.${system}.hyprwinview;
@@ -529,7 +538,8 @@
hyprexpo-lua = inputs.hyprland-plugins-lua.packages.${system}.hyprexpo; hyprexpo-lua = inputs.hyprland-plugins-lua.packages.${system}.hyprexpo;
hyprwinview = inputs.hyprwinview.packages.${system}.hyprwinview; hyprwinview = inputs.hyprwinview.packages.${system}.hyprwinview;
hypr-workspace-history = inputs.hypr-workspace-history.packages.${system}.hypr-workspace-history; hypr-workspace-history = inputs.hypr-workspace-history.packages.${system}.hypr-workspace-history;
hyprland-config-syntax = pkgs.runCommand "hyprland-config-syntax" { hyprland-config-syntax =
pkgs.runCommand "hyprland-config-syntax" {
nativeBuildInputs = [pkgs.lua5_4]; nativeBuildInputs = [pkgs.lua5_4];
} '' } ''
cp ${../dotfiles/config/hypr/hyprland.lua} hyprland.lua cp ${../dotfiles/config/hypr/hyprland.lua} hyprland.lua
@@ -654,7 +664,8 @@
hyprland-verify-config = let hyprland-verify-config = let
hyprlandPackage = inputs.hyprland.packages.${system}.hyprland; hyprlandPackage = inputs.hyprland.packages.${system}.hyprland;
hyprNStackPackage = inputs.hyprNStack.packages.${system}.hyprNStack; 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 cp ${../dotfiles/config/hypr/hyprland.lua} hyprland.lua
substituteInPlace hyprland.lua \ substituteInPlace hyprland.lua \
--replace-fail /run/current-system/sw/lib/libhyprNStack.so \ --replace-fail /run/current-system/sw/lib/libhyprNStack.so \

View File

@@ -1,18 +1,31 @@
{ config, lib, pkgs, inputs, makeEnable, ... }: {
let config,
lib,
pkgs,
inputs,
makeEnable,
...
}: let
cfg = config.myModules."keepbook-sync"; cfg = config.myModules."keepbook-sync";
keepbookTray = keepbookPackages = inputs.keepbook.packages.${pkgs.stdenv.hostPlatform.system};
inputs.keepbook.packages.${pkgs.stdenv.hostPlatform.system}.keepbook-tray.overrideAttrs (_: { keepbookTray = keepbookPackages.keepbook-tray.overrideAttrs (_: {
# Upstream currently includes a contract test that expects a built TS CLI # 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 # entrypoint under ts/dist/, but the Nix build does not build the TS
# artifacts first. Skip checks to keep the package usable on NixOS. # artifacts first. Skip checks to keep the package usable on NixOS.
doCheck = false; doCheck = false;
}); });
keepbookDioxusDesktopPackages =
lib.optional (keepbookPackages ? keepbook-dioxus-desktop)
keepbookPackages.keepbook-dioxus-desktop;
daemonArgs = [ daemonArgs =
"--config" cfg.configPath [
"--interval" cfg.interval "--config"
"--jitter" cfg.jitter cfg.configPath
"--interval"
cfg.interval
"--jitter"
cfg.jitter
] ]
++ lib.optionals (cfg.historyPoints != null) ["--history-points" (toString cfg.historyPoints)] ++ lib.optionals (cfg.historyPoints != null) ["--history-points" (toString cfg.historyPoints)]
++ lib.optionals (!cfg.syncOnStart) ["--no-sync-on-start"] ++ lib.optionals (!cfg.syncOnStart) ["--no-sync-on-start"]
@@ -24,7 +37,7 @@ let
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 { enabledModule = makeEnable config "myModules.keepbook-sync" false {
environment.systemPackages = [ keepbookTray ]; environment.systemPackages = [keepbookTray] ++ keepbookDioxusDesktopPackages;
home-manager.users.${cfg.user} = { home-manager.users.${cfg.user} = {
systemd.user.services.keepbook-sync-daemon = { systemd.user.services.keepbook-sync-daemon = {
@@ -47,7 +60,8 @@ let
}; };
}; };
in in
enabledModule // { enabledModule
// {
# Merge our extra options with the enable option produced by makeEnable. # Merge our extra options with the enable option produced by makeEnable.
options = lib.recursiveUpdate enabledModule.options { options = lib.recursiveUpdate enabledModule.options {
myModules."keepbook-sync" = { myModules."keepbook-sync" = {
@@ -110,7 +124,6 @@ enabledModule // {
default = null; default = null;
description = "Optional override for the maximum recent portfolio history rows shown in the tray menu."; description = "Optional override for the maximum recent portfolio history rows shown in the tray menu.";
}; };
}; };
}; };
} }