keepbook: install dioxus desktop app
This commit is contained in:
18
nixos/flake.lock
generated
18
nixos/flake.lock
generated
@@ -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": {
|
||||||
|
|||||||
@@ -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 @ {
|
||||||
@@ -266,10 +265,10 @@
|
|||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
# Nixpkgs PR patches - just specify PR number and hash
|
# Nixpkgs PR patches - just specify PR number and hash
|
||||||
nixpkgsPRPatches = [ ];
|
nixpkgsPRPatches = [];
|
||||||
|
|
||||||
# Custom patches that don't fit the PR template
|
# Custom patches that don't fit the PR template
|
||||||
nixpkgsCustomPatches = [ ];
|
nixpkgsCustomPatches = [];
|
||||||
|
|
||||||
# Home-manager PR patches - just specify PR number and hash
|
# Home-manager PR patches - just specify PR number and hash
|
||||||
homeManagerPRPatches = [
|
homeManagerPRPatches = [
|
||||||
@@ -328,7 +327,7 @@
|
|||||||
builtins.listToAttrs (map mkConfigurationParams machineFilenames);
|
builtins.listToAttrs (map mkConfigurationParams machineFilenames);
|
||||||
# Build org-agenda-api container for a given system
|
# Build org-agenda-api container for a given system
|
||||||
mkOrgAgendaApiContainerInfo = system: let
|
mkOrgAgendaApiContainerInfo = system: let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs {inherit system;};
|
||||||
orgApiRev = builtins.substring 0 7 (org-agenda-api.rev or "unknown");
|
orgApiRev = builtins.substring 0 7 (org-agenda-api.rev or "unknown");
|
||||||
dotfilesRev = builtins.substring 0 7 (self.rev or self.dirtyRev or "dirty");
|
dotfilesRev = builtins.substring 0 7 (self.rev or self.dirtyRev or "dirty");
|
||||||
dotfilesOrgApi = import ./org-agenda-api.nix {
|
dotfilesOrgApi = import ./org-agenda-api.nix {
|
||||||
@@ -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,9 +497,10 @@
|
|||||||
mkConfig (params // machineParams)
|
mkConfig (params // machineParams)
|
||||||
)
|
)
|
||||||
defaultConfigurationParams;
|
defaultConfigurationParams;
|
||||||
} // flake-utils.lib.eachDefaultSystem (system:
|
}
|
||||||
let
|
// flake-utils.lib.eachDefaultSystem (
|
||||||
pkgs = import nixpkgs { inherit system; };
|
system: let
|
||||||
|
pkgs = import nixpkgs {inherit system;};
|
||||||
lib = pkgs.lib;
|
lib = pkgs.lib;
|
||||||
|
|
||||||
# Get short revs for tagging
|
# Get short revs for tagging
|
||||||
@@ -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,8 +538,9 @@
|
|||||||
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 =
|
||||||
nativeBuildInputs = [ pkgs.lua5_4 ];
|
pkgs.runCommand "hyprland-config-syntax" {
|
||||||
|
nativeBuildInputs = [pkgs.lua5_4];
|
||||||
} ''
|
} ''
|
||||||
cp ${../dotfiles/config/hypr/hyprland.lua} hyprland.lua
|
cp ${../dotfiles/config/hypr/hyprland.lua} hyprland.lua
|
||||||
luac -p hyprland.lua
|
luac -p 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 \
|
||||||
|
|||||||
@@ -1,53 +1,67 @@
|
|||||||
{ 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"]
|
||||||
++ lib.optionals (!cfg.syncPrices) [ "--no-sync-prices" ]
|
++ lib.optionals (!cfg.syncPrices) ["--no-sync-prices"]
|
||||||
++ lib.optionals (!cfg.syncSymlinks) [ "--no-sync-symlinks" ]
|
++ lib.optionals (!cfg.syncSymlinks) ["--no-sync-symlinks"]
|
||||||
++ lib.optionals (cfg.balanceStaleness != null) [ "--balance-staleness" cfg.balanceStaleness ]
|
++ lib.optionals (cfg.balanceStaleness != null) ["--balance-staleness" cfg.balanceStaleness]
|
||||||
++ lib.optionals (cfg.priceStaleness != null) [ "--price-staleness" cfg.priceStaleness ];
|
++ 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 {
|
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 = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "keepbook sync daemon";
|
Description = "keepbook sync daemon";
|
||||||
After = [ "graphical-session.target" "tray.target" ];
|
After = ["graphical-session.target" "tray.target"];
|
||||||
PartOf = [ "graphical-session.target" ];
|
PartOf = ["graphical-session.target"];
|
||||||
Requires = [ "tray.target" ];
|
Requires = ["tray.target"];
|
||||||
};
|
};
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = daemonExec;
|
ExecStart = daemonExec;
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
RestartSec = 5;
|
RestartSec = 5;
|
||||||
Environment = [ "RUST_LOG=info" ];
|
Environment = ["RUST_LOG=info"];
|
||||||
};
|
};
|
||||||
Install = {
|
Install = {
|
||||||
WantedBy = [ "graphical-session.target" ];
|
WantedBy = ["graphical-session.target"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
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.";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user